Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |