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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
ar-data
Helper II
Helper II

Category percentage and quarter wise percentage for each year

I have data with columns 

1. Year

2. Quarter

3. Category

4. Sub-Category

5. Values

 

Now I want to calculate percentage at each level to the total value at that particular level. For example

1. At quarter it will be Quarter1 Value / Value for all Quarters for that Year

2. At Category it will be Category1 Value / Value for all Categories for that Quarter & Year

3. At Sub-Category it will be Sub-Category1 Value / Value for all Sub-Categories for that Category for that Quarter & Year

I will be using a Clustered Column Chart with Axis as FY->Quarter->Category->Sub-Category drill downs.

I tried All, AllExcept, HasOneValue, IsFiltered and nothing seem to work. Can someone help me with this. Also, should I use different measure at different hierarchy/drilldown level?

1 ACCEPTED SOLUTION
ar-data
Helper II
Helper II

I thought I tried all solutions but I am not sure how I missed the AllSelected filter.

 

The formula that solved the issue was:

% = Sum(Values) / Calculate ( Sum( Values ), AllSelected(DataTable) )

 

View solution in original post

3 REPLIES 3
ar-data
Helper II
Helper II

I thought I tried all solutions but I am not sure how I missed the AllSelected filter.

 

The formula that solved the issue was:

% = Sum(Values) / Calculate ( Sum( Values ), AllSelected(DataTable) )

 

Jihwan_Kim
Super User
Super User

Hi, @ar-data 

Please correct me if I wrongly understand your question.

Please try creating the below measures for your totals. And then, you can apply each to your percentage calculation.

 

1. for your yearly total calculation -> calculate (your measure, ALL(TABLE), VALUES(year column))

2. for your quarterly and yearly total calculation -> calculate (your measure, ALL(Table), VALUES(year column), VALUES(quarter column))
3. for your category, quarterly, yearly total calculation -> calculate (your measure, ALL(Table), VALUES(year column), VALUES(quarter column), VALUES(category column))

 

If it does not work, please let me know and please share some sample pbix file, then I can come up with more accurate measures.

 

Thank you very much.

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Hi @Jihwan_Kim , Thanks for the quick response. The problem is I need one measure to calculate the % at all levels as I will be using a clustered chart with drill downs and the % to be dynamically calculated at each level when user drills down.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.