Forum Discussion
Displaying ISINSCOPE
- 7 years ago
You can easily solve the issue by converting you model to a Star Schema.
1. Create 2 new tables as below:
Company = DISTINCT('Table'[Company]) Product = DISTINCT('Table'[Product Type])2. Create 2 new relationships:
Table[Company] <- Company[Company]
Table[Product Type] <- Product[Product Type]
3. Now replace the dimensions in your existing visuals & slicers with the columns from the new Lookup tables.
4. Just use the same old measure for Market Share:
Market Share = DIVIDE ( [Total Value], CALCULATE ( [Total Value], ALL ( 'Table'[Company] ) ) )
The issue you faced is happening because of the Auto Exists feature in DAX.
Sample data would be immensely helpful. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
For reference, This is my results with slicers all selected.
- AkhilAshok7 years agoSolution Sage
Why not just trying to explicitly consider all products while calculating the Market Share for a Company?
Market Share = DIVIDE ( [Total Value], CALCULATE ( [Total Value], ALL ( 'Table'[Company] ), VALUES ( 'Table'[Product Type] ) ) )- Reigning_data7 years agoFrequent Visitor
Hi AkhilAshok,
Many thanks for your response.
Unfortunately this still does not give the desired results.
See below (renamed to Market Share 2.0)
Market share when highlighting Company A and all 3 slicers selected should be 32.6%
- AkhilAshok7 years agoSolution Sage
Well, then I misunderstood your requirment. If that is the case, then I'm curious why your original code didn't work? Below code should give 32.6%
Market Share = DIVIDE ( [Total Value], CALCULATE ( [Total Value], ALL ( 'Table'[Company] ) ) )