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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
m_wex
Helper I
Helper I

Stuck on %of Total Problem

I am working with grouping previous year customer sales into small, medium, and large buckets. A Customer size table has been created for the grouping:

m_wex_0-1715981980332.png

With a page filter for small, medium, and large sales can be displayed for the selected size.

The dax formula to calculate sales is:

 

CY Customer Sales by Grouping  4 Test =
Calculate([CY Total Sales],
filter(values(Sales[Sold-To Party]),  
    countrows(
        Filter('Customer Size Table',
        [PY Total Sales]>='Customer Size Table'[Min]&&
        [PY Total Sales]<= 'Customer Size Table'[Max]))>0))
 
The problem that I am having is that I am trying to write a DAX for % of Total sales which compares the size selected to ALL sizes.
The formula that I have is below but is not working. I understand that the size filter has to be removed from one portion of the DAX but the solution is escaping me.
 
This does not work: % of Total Customer Size Test 4 = divide([CY Customer Sales by Grouping  4 Test],calculate([CY Customer Sales by Grouping  4 Test]),all('Customer Size Table'[Size]))
 
Any help would be greatly appreciated.
 
 
1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @m_wex 

You can perform a flexible % analysis using Dax, and there are many ways to produce your required output and one of them is as follows.  (I've created a dummy sales data in order to demonstrate in this example). 

Assuming that your Sold-To-Party information is not repetitive (i.e., unique), you can create a calculated column to pre-calculate classification into sales size groupings for each sold-to-party.

DataNinja777_0-1716012175170.png

 

Then create a relationship between your size dimension table and your fact table with the sales figures and sales size grouping for each sold-to-party.

DataNinja777_1-1716012267680.png

Then, create an intermediary measure like below which ignores filter of the size dimention by using all(Size) table, and divide the sales measure with this one to get the % of each size grouping over the total sales amounts. 

DataNinja777_2-1716012343094.png

You can do the similar calculation in many different ways, but the above one is breaking down the steps for simplicity purposes. 

I attach an example pbix file, too.  

Best regards,

 

 

View solution in original post

1 REPLY 1
DataNinja777
Super User
Super User

Hi @m_wex 

You can perform a flexible % analysis using Dax, and there are many ways to produce your required output and one of them is as follows.  (I've created a dummy sales data in order to demonstrate in this example). 

Assuming that your Sold-To-Party information is not repetitive (i.e., unique), you can create a calculated column to pre-calculate classification into sales size groupings for each sold-to-party.

DataNinja777_0-1716012175170.png

 

Then create a relationship between your size dimension table and your fact table with the sales figures and sales size grouping for each sold-to-party.

DataNinja777_1-1716012267680.png

Then, create an intermediary measure like below which ignores filter of the size dimention by using all(Size) table, and divide the sales measure with this one to get the % of each size grouping over the total sales amounts. 

DataNinja777_2-1716012343094.png

You can do the similar calculation in many different ways, but the above one is breaking down the steps for simplicity purposes. 

I attach an example pbix file, too.  

Best regards,

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.