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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
0Experience
Helper I
Helper I

Seeking Assistance with Calculations and Percentages on a Table

Hello Everyone,

 

I hope you're doing well. I have a slide with a filter and a table displaying Year, Zone, and Loc_Pop. When I select an option from the filter, the table updates to show Year, Zone, and Loc_Pop for the selected location. Here, I am considering "Cat_total" from the category.

 

0Experience_4-1707623942816.png

 

Now, I'm looking to enhance the table by adding some additional columns:

  1. Sum_of_the_Same_Zone_Loc_Pop:

    • This column should display the sum of Loc_Pop for all locations within the same zone as the selected location from the filter (for each year.)
    • Based on the above example, I want to sum for all location those are on the "N" zone (for each year).
  2. Percentage_Zone:

    • This column should show the percentage of the "Sum_of_the_Same_Zone_Loc_Pop" compared to the "Loc_Pop".
  3. Sum_of_All_Zone_Loc_Pop:

    • This column should show the sum of Loc_Pop for all zones for each year.
  4. Percentage_All_Zones:

    • Similar to the previous column, this should display the percentage of "Sum_of_All_Zone_Loc_Pop" compared to the individual "Loc_Pop".

The output should something like the below:

0Experience_5-1707624125541.png

 

I'd greatly appreciate any guidance on how to implement these additions effectively. Thank you so much for your help!

.pibx can be accessed from here (Google Drive Link). 

1 ACCEPTED SOLUTION
sayaliredij
Super User
Super User

Hi @0Experience 

 

Please refer the file saved in following location

 

filter_sum.pbix

 

Measures:

  1. Sum of the Same Zone Loc Pop:

    This measure calculates the sum of the population in the same zone as the current location.

    Sum_of_the_Same_Zone_Loc_Pop = CALCULATE(SUM(Table1[Loc_Pop]), ALL(Table1[Location]))
  2. Percentage Zone:

    This measure calculates the percentage of the total population that is in the same zone as the current location.

    Percentage_Zone = FORMAT(DIVIDE(SUM(Table1[Loc_Pop]), [Sum_of_the_Same_Zone_Loc_Pop]), "0.00%")
  3. Sum of All Zone Loc Pop:

    This measure calculates the sum of the population in all zones.

    Sum_of_All_Zone_Loc_Pop = CALCULATE(SUM(Table1[Loc_Pop]), ALL(Table1[Location]))
  4. Percentage All Zones:

    This measure calculates the percentage of the total population that is in all zones.

    Percentage_All_Zones = FORMAT(DIVIDE(SUM(Table1[Loc_Pop]), [Sum_of_All_Zone_Loc_Pop]), "0.00%")

I hope this is helpful!

 

Thanks and Regards,

Sayali

Please mark the question solved when done and consider giving a thumbs up if posts are helpful!! 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
sayaliredij
Super User
Super User

Hi @0Experience 

 

Please refer the file saved in following location

 

filter_sum.pbix

 

Measures:

  1. Sum of the Same Zone Loc Pop:

    This measure calculates the sum of the population in the same zone as the current location.

    Sum_of_the_Same_Zone_Loc_Pop = CALCULATE(SUM(Table1[Loc_Pop]), ALL(Table1[Location]))
  2. Percentage Zone:

    This measure calculates the percentage of the total population that is in the same zone as the current location.

    Percentage_Zone = FORMAT(DIVIDE(SUM(Table1[Loc_Pop]), [Sum_of_the_Same_Zone_Loc_Pop]), "0.00%")
  3. Sum of All Zone Loc Pop:

    This measure calculates the sum of the population in all zones.

    Sum_of_All_Zone_Loc_Pop = CALCULATE(SUM(Table1[Loc_Pop]), ALL(Table1[Location]))
  4. Percentage All Zones:

    This measure calculates the percentage of the total population that is in all zones.

    Percentage_All_Zones = FORMAT(DIVIDE(SUM(Table1[Loc_Pop]), [Sum_of_All_Zone_Loc_Pop]), "0.00%")

I hope this is helpful!

 

Thanks and Regards,

Sayali

Please mark the question solved when done and consider giving a thumbs up if posts are helpful!! 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@sayaliredij thanks for your answer, and sorry for the late reply.

 

I can see that "Sum_of_the_Same_Zone_Loc_Pop" and "Sum_of_All_Zone_Loc_Pop" have the same formula (as stated in your post, but the correct answer is in the attachment), as well as for the percentage calculation.

 

 

 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.