Calculate the number of empty/blank fields in Power Bi - database

Hi I'm using a table which has a column Person Name followed by other columns that describes that Person i.e. Height, Age etc. The rows are filled in with the info.
However, some cells for specific people are not filled in therefore I would like to see which Person is missing details and what details are they missing as well as how many People are missing details altogether? Is there a way I can calculate/demonstrate that on Power Bi?
So essentially, count number of rows with at least one empty cell.

Creating a measure like this works for me
CALCULATE(countrows(tablename) , isblank(table(columnname))

Related

How could I only show the min in MS Access?

I am very new to access.
I tried to filter the data by using Totals and grouped the productPrice by min, however I get a range of all the product prices from min to max, here is a screenshot.
Also there is another column after MinOfproductPrice called storeName, I didn't include it for privacy reasons.
How could I make it so only the lowest price per product is shown? An example of what I am trying to do.
You could just do a summary query and do a group by with min (as you have done), but I suspect that the column you removed is to blame as it sounds like you want to be able to show that information as well.
There are a few ways to do this. In the first, you'll need to first create a summary query that gets just the product id and minimum price. Then, link this query back to your main table/query to get the additional columns like store, container, etc.
It is similar to finding just the most recent order row for each of your customers. The technique is the same. You can see a demo here:
https://youtu.be/5cnwHyn4dnI

SSRS - Group Columns Together

All:
I have the following data (see Raw Data attachment). Inside my SSRS Report, I have a column for "Name / Stream / Offer One / Offer Two" (Name is the column for the "Value" column shown in the image).
I need my SSRS Report to display one row of the "totals" for each Name. Then under this, I need a row for each Stream associated with the Name that displays the values for that stream.
For the SSRS Output (please see second screen shot). The data loads into my tablix, but I need one row for "BAG-CV" that displays the total for that Name. Then under this row, I need a row for "AR" stream with the data for.
If you see Name: JAC-FL, it has 5 streams listed under it. So I would need one row for the total of JAC-FL, then 5 rows under it listing all the streams associated with this name.
Hopefully this makes sense.
The concept that you are describing is a nested parent/child group (two levels of grouping in a single table). This is quite easy to do and I'll walk you through the steps for your particular scenario thanks to the helpful description and screenshots that you posted.
Create table: I would advise always starting with the innermost grouping and building the table outwards. In your case, the lowest data granularity is Stream/Offer1/Offer2 as these are displayed as raw details with no aggregation:
Add Parent Group For "Name": Click on the group at the bottom (or in the table) and add a parent group to the current table details group, making sure to include a group header (for the sum):
Screenshot #1:
Screenshot #2:
Add Fields: Add the additional fields to your table, ensuring that the middle row is using SUM aggregation as per the screenshot:
Results: You should see the additional header row on the parent group with the desired SUM.
Cleanup: The example above just creates the most basic and bare functionality. I would suggest cleaning it up and adding a visibility toggle on the details group:
PS. I realize you probably aren't in control of the database schema, but wow, exclamation marks in column names would drive me up the wall :)

Summing the Non-Null results in a matrix

I have a report that looks like the picture below. It is a matrix with person name on the rows and weeknum on the columns. What I need to calculate is the number of weeks that have data in the calls taken column. In the picture below it is the consistency column with the red numbers. I can't seem to get those red numbers to appear. Is there an expression that can count the number of columns that aren't null in a particular matrix. This report will be dynamically generated and the number of weeks will be totally different each time.
I would rather solve this in SSRS because I don't want to mess with my SQL too much but if no SSRS solution is possible I can post my SQL and perhaps solve it that way.
You need to create a column group outside of the last group. So in your example, Right click on the column tab above your efficiency column in the 23rd week. After you create this column, you can use a simple Count(Fields!CallsTaken.Value) in an expression to count the times there are values listed.
Reference SO question on Horizontal Totals.

Database Design for Expanding Lists

Admittedly, I am simply looking for some direction here. I have a specific situation, and being a novice in database design I am lost on how to begin tackling this problem. Let me start by explaining my situation.
I have a mysql table called contacts. As the name infers, it stores a list of contacts and the attributes that go along with each such as first name, last name, email, phone number etc. I would like users of my application to be able to add an unlimited amount of certain attributes for each contact. So, for instance rather than a contact having one phone number, the user could add another number, and another if they choose etc so essentially, a contact in my database can have as many phone numbers as the user needs. This will also be true for other fields in the table, but for the sake of simplicity let's just stick with phone number as an example.
So what is the best way to approach this? Should I have a separate table called contactsPhone and have a matching id column so that any number of rows in the phone table can be associated with one row in the contacts table? Or is there a way to store an ArrayList of some sort in the contacts table so I can have multiple phone numbers in just one field?
You should be looking at modelling something like this in a document database - a relational database is a poor choice for a flexible schema. You may be able to just have this specific portion of you data in a document database.
If you must, the common solution is the entity-attribute-value pattern - note that this requires multiple joins, makes ad-hock queries difficult and is generally slow.
Update:
I misread the question a bit - if you do know which attributes you want to hold multiple values and this list will not change (or not change much), entity-attribute-value may not be the best way forward.
A one-to-many table per each of these attributes will work (and is a standard relational solution for this kind of problem) - each such table will require a foreign key to your contacts table and a column to hold a single attribute value. This allows you to have multiple attribute values against a single contact.
I would like users of my application to be able to add an unlimited
amount of certain attributes for each contact. So, for instance rather
than a contact having one phone number, the user could add another
number, and another if they choose etc so essentially, a contact in my
database can have as many phone numbers as the user needs.
You're not describing an unlimited number of attributes for each contact. (That's a Good Thing.) You're describing an unlimited number of rows for a single attribute, in this case a contact's phone number.
So, yes, a table of contact phone numbers would work well. You might want to give some thought to how the user might want to identify phone numbers. For example, do they need to distinguish home phone numbers from work numbers and so on.

Auto filling a field in access 2003 with data from another table

I have an access 2003 database with many tables. Here is an example of what i am trying to achieve. I have a table and form for my candidates. On this table is a field for name and a field for an enrolment number. Is it possible for my other form to fill in the enrolment number on that form automatically when the same name is selected. For example, if I have a candidate on my candidates table with an enrolment number filled in. If I select that candidate on my other form how can I make it automatically fill in the enrolment number. Hope this is clear enough.
Any help would be greatly appreciated. Thanks.
There are several ways to do this.
If you are using a combo box to select the candidate from the candidates table, the enrollment number can be one of the columns, in which case you can simply refer to the column in the controlsource of a textbox:
=MyCombo.Column(2)
Similarly, you can use DLookUp, but it can be comparatively slow if your tables are large:
=DlookUp("enrollmentnumber","candidates","UniqueNumericID=" UniqueNumericID)
Where UniqueNumericID is a control or field (column) in the form or the form's recordset.
It may also be possible to create a query that holds all the relevant data and use that for your form's recordsource. This is quite a nice solution, usually, for example:
SELECT This, That, Candidates.EnrollmentNumber
FROM ExamsJunctionTable
INNER JOIN Candidates
ON ExamsJunctionTable.CandidateID = Candidates.UniqueCandidateID
For this to work properly you need to ensure that you database is well set-up and that the queries that need to be updatable are updatable.

Resources