Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Sergius
Regular Visitor

Calculating % based on unique id and status

image.pngDear community!

 

Recently I have faced with one problem, so needs your help. 

 

I have one database, with unique id, regions and status, that looks like

image.png

 

and separate table with population data 

image.png

what I need is to summarize id and calculate %  where numerator will be sum id of uniq region (but only with TRUE status) and denominator  -  population of the same region. 

1 ACCEPTED SOLUTION

@Sergius,

Please check the DAX in the PBIX file below.
https://1drv.ms/u/s!AhsotbnGu1Nok1EZ842f9zPj1ZiM

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Floriankx
Solution Sage
Solution Sage

Hello,

 

You could have posted an example of your expected result.

 

You may need something like a mixture of SUMMARIZE and FILTER.

 

But without knowing aim and proper dummy data it is really hard to tell.

Each unique ID is an indificator of the person. 

 

The first step could be calculate number of IDs (whith status TRUE) for each region, to understand how many people are in data base.

Than caclulate % from total population of the region.

 

But how?

 

@Sergius,

Please check the DAX in the PBIX file below.
https://1drv.ms/u/s!AhsotbnGu1Nok1EZ842f9zPj1ZiM

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yuezhe-msft,

 

thank you, but I only thing that was missed is that IDs represented people from these regions and should be calculated for each region separately. In this example they were calculated for all regions without desagregation.

@Sergius,

Please post expected result based on the sample data you provide.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Sergius,


My DAX should work with your new sample data.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much! It is great! 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.