Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I have a list of persons who are assigned to sites.
For each day, i want to see what persons were onsite and what persons were not.
I need to be able to do this while still filtering by site. i.e. i only see persons for the selected site.
The issue i have is if i create a measure to count a users records, users with no records will not be present.
If i wrap that measure in an IF, so it assigns 0 if there is no record, i see all persons for all sites, not a problem here, but in my real dataset with thousands of persons, it is a big issue.
How can i see all persons for the select site, and if they were present on a paritcular day or not?
Below is a screenshot of sample data and desired result if i had selected site A, and a link to a pbix containing this sample data. Appretiate any expertise provided.
https://1drv.ms/u/s!AgldA0VQfPV9hNtsompxszevR8TRTA?e=viRG1j
Solved! Go to Solution.
You could use this measure as below:
Records =
IF(CALCULATE(MAX('Fact'[personid]))<>BLANK()&&MAX(DimPerson[assigned site]) in VALUES(DimSite[siteID]),1,IF(MAX(DimPerson[assigned site]) in VALUES(DimSite[siteID]),0))
Result:
here is sample pbix file, please try it.
Regards,
Lin
I have changed the relationships and get the following result with your attached pbix file (see below):
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
thanks. thats a help, and its helped me refine my question!
This shows persons with no records, but if i select a date, i only see people on that date. On any given day, i need to see the people who were onsite and the people who were not. An indicator measure would work, i.e. 1 if they were onsite, 0 if they were not.
Will play with and build on the idea you provided.
Thanks!
You could use this measure as below:
Records =
IF(CALCULATE(MAX('Fact'[personid]))<>BLANK()&&MAX(DimPerson[assigned site]) in VALUES(DimSite[siteID]),1,IF(MAX(DimPerson[assigned site]) in VALUES(DimSite[siteID]),0))
Result:
here is sample pbix file, please try it.
Regards,
Lin
User | Count |
---|---|
118 | |
66 | |
65 | |
56 | |
50 |
User | Count |
---|---|
181 | |
85 | |
67 | |
61 | |
53 |