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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
depple
Helper III
Helper III

Measure - Market share of grand total

Hi,

 

First of all, I am quite a newbie with creating Dax measures, so please bear over with my shortcomings of knowledge (and probably also ability to explain the actual issue).

 

Primarily, I am trying to visualize (line chart) the development of market share of a selected group of products, the base being sales of all products

 

Mockup of all data (no column for :

table1

ProductTypeData levelSizeSalesShare of Grand Total Sales
AlfaAGeographyS100,10
BravoBGeographyM150,15
CharlieBChainL250,25
DeltaCChainM400,40
EchoBChainM100,10
Grand Total   1001

 

So the key is: After slicer operations, the Sales of each product is to be measured against the "all" salesa in the table.

 

Desired result of measure (* mark slicer selections)

ProductType*Data level*SizeSalesShare of Grand Total Sales
CharlieBChainL250,25
EchoBChainM100,1
Total    0,35

 

My secondary challenge, due to the data structure, I need the Dax measure to control which of the slicers that should influence the base (and others not). Is this possible?

 

I would really appreciate any input.

 

Regards,

depple

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@depple 

You can create the following measure to get the desired results:

Share of Grand Total Sales = 
DIVIDE(
    SUM(SalesData[Sales]),
    CALCULATE(
            SUM(SalesData[Sales]),
            ALL(SalesData)
    )
)


If you need to control the clearing of filters then you can selectively choose with ALLEXCEPT as follows:

Share of Grand Total Sales = 
DIVIDE(
    SUM(SalesData[Sales]),
    CALCULATE(
            SUM(SalesData[Sales]),
            ALLEXCEPT(SalesData, SalesData[Type])
    )
)






Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@depple 

You can create the following measure to get the desired results:

Share of Grand Total Sales = 
DIVIDE(
    SUM(SalesData[Sales]),
    CALCULATE(
            SUM(SalesData[Sales]),
            ALL(SalesData)
    )
)


If you need to control the clearing of filters then you can selectively choose with ALLEXCEPT as follows:

Share of Grand Total Sales = 
DIVIDE(
    SUM(SalesData[Sales]),
    CALCULATE(
            SUM(SalesData[Sales]),
            ALLEXCEPT(SalesData, SalesData[Type])
    )
)






Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi @Fowmy 

 

That worked perfectly!

 

Ended up with quite a lot of ALLEXCEPT-columns, maybe there should be a ALLSELECTEDEXCEPT function 🙂

 

Thank you very much for your help, that really pushed my report forward.

 

/depple

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.