Forum Discussion
% of static parent value in matrix
- 2 years ago
This set me on the right track. Here is the measure I am using, and its correct output:
% of total (ignoring filters) =
VAR _pct = DIVIDE( 'Fact'[t100], CALCULATE( [test 2], ALLSELECTED()))
// 'test 2' is a simple measure that calculates a sum, ignoring visual level filters I have applied using ALL()
RETURN
IF( ISINSCOPE( 'Mapping Table2[Row2] ), _pct, DIVIDE('Fact'[t100], [test 2]))
Hi goosefrabah ,
Please check the following blog, hope it can help you resolve the problem.
Use IsInScope to get the right hierarchy level in DAX - Kasper On BI
Measure =
VAR grandtotal =
CALCULATE ( [Sum of Value], Sellers[IsTotal] = 3 )
VAR sellersum =
CALCULATE ( [Sum of Value], Sellers[IsTotal] = 0 )
VAR sellerselected =
ISINSCOPE ( sellers[Seller] )
VAR channelselected =
ISINSCOPE ( sellers[channel] )
VAR Countrysum =
CALCULATE (
[Sum of Value],
Sellers[IsTotal] = 1,
ALLEXCEPT ( Sellers, Sellers[COUNTRY] )
)
VAR Countryselected =
ISINSCOPE ( sellers[Country] )
VAR Regionsum =
CALCULATE (
[Sum of Value],
Sellers[IsTotal] = 2,
ALLEXCEPT ( Sellers, Sellers[Region] )
)
VAR Regionselected =
ISINSCOPE ( sellers[Region] )
RETURN
SWITCH (
TRUE (),
sellerselected, sellersum,
channelselected, BLANK (),
countryselected, Countrysum,
regionselected, Regionsum,
grandtotal
)
If the above one can't help you get the expected result, please provide some raw data in your table 'Mapping Table 2' (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
This set me on the right track. Here is the measure I am using, and its correct output:
% of total (ignoring filters) =
VAR _pct = DIVIDE( 'Fact'[t100], CALCULATE( [test 2], ALLSELECTED()))
// 'test 2' is a simple measure that calculates a sum, ignoring visual level filters I have applied using ALL()
RETURN
IF( ISINSCOPE( 'Mapping Table2[Row2] ), _pct, DIVIDE('Fact'[t100], [test 2]))