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

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.

Reply
Anonymous
Not applicable

% of Filtered Total

Hi,

 

I am trying to get a very simple (or so I thought it was) DAX expression for the following scenario:

 

I have sales for multiple brands and multiple geographies. I want to show geographies and what the % of total sales are for whatever Brand is filtered for all of the geographies.

 

Any ideas?

 

Any help?

13 REPLIES 13
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can use ALLEXCEPT() function.

Check the pbix as attached and refer to the formula see if it helps.

If you can show some sample data and expected out put then it will be great helpful.

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

@v-jayw-msft 

 

Thank you....One thing I failed to mention is that this formula is going to be in a decomposition tree, therefore when user selects first branch it would be brand, then they select next branch which would be sub-category, then next branch segment.

 

How do we account for different dimension as they drill through branches of decomp tree?

Hi @Anonymous ,

 

So basically you want sales for each brand/total sales in first branch, sales for each brand and geographies/total sales in second branch?

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
az38
Community Champion
Community Champion

Hi @Anonymous 

It actually looks pretty easy, but also it has a few solution.

So, please give an example of data model and desired output for more appropriated one


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 MY BI file is 279m so not sure how to do this?

az38
Community Champion
Community Champion

@Anonymous 

just part of your data.

it could be dummy data, 10-15 rows to understand how exactly do you want to calculate it

 

I can try to write you a very common statement like

Measure = 
DIVIDE(
CALCULATE(SUM(Table[Sales]), ALLEXCEPT(Table, Table[Brand], Table[Geography])),
CALCULATE(SUM(Table[Sales]), ALLEXCEPT(Table, Table[Geography]))
)

 

I hope it will help you


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 WIll that DAX work if this is meant for a decomposition where I continue clicking down a hierarchy?

az38
Community Champion
Community Champion

@Anonymous 

will it work or not depends on data model. in common case - yes, it will

you can share your Excel into cloud service and give the link here


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

az38
Community Champion
Community Champion

@Anonymous 

you can use option "Show value as" to get smth like this

Безымянный.png


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 when you put the data into a decomposition tree and filter on brands the numbers are not accurate. Try to do that on your end.

az38
Community Champion
Community Champion

@Anonymous 

you've got a lot of columns here. what do you want to achieve?

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

How do I attach the Excel dummy data?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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