The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi all.
I am trying to work out the total percentage of different populations that we have scanned on the program.
I have created a measure to filter out the patients by location. For example, the Rotherham patients measure is:
Solved! Go to Solution.
I'll suggest a different approach, so that you don't need to create separate measures for each town.
Create a dimension table which lists all the towns and their populations. You can do this in Power Query, by duplicating or referencing your existing table, discarding all other columns and then removing duplicate values, or you could do it in DAX like
Population =
SUMMARIZE ( 'Table', 'Table'[Town], 'Table'[Population] )
Create a one-to-many relationship from this new table to your current table, and you can then use the Population table to filter the fact table. Put the town column from Population into visuals or slicers and it will break everything down by town.
You can then create a measure to show the % scanned as
% scanned =
DIVIDE (
COUNTROWS ( 'TLHC Total Patients Scanned' ),
SUM ( 'Population'[Population] )
)
which should work at the grand total level as well as at the town level.
@johnt75 Hi, thank you for the speedy response.
Amazing. Thank you so much! This has worked.
I'll suggest a different approach, so that you don't need to create separate measures for each town.
Create a dimension table which lists all the towns and their populations. You can do this in Power Query, by duplicating or referencing your existing table, discarding all other columns and then removing duplicate values, or you could do it in DAX like
Population =
SUMMARIZE ( 'Table', 'Table'[Town], 'Table'[Population] )
Create a one-to-many relationship from this new table to your current table, and you can then use the Population table to filter the fact table. Put the town column from Population into visuals or slicers and it will break everything down by town.
You can then create a measure to show the % scanned as
% scanned =
DIVIDE (
COUNTROWS ( 'TLHC Total Patients Scanned' ),
SUM ( 'Population'[Population] )
)
which should work at the grand total level as well as at the town level.