Forum Discussion
Ignore Slicer and multiply by selected value
- 5 years ago
Hi shutevd ,
Please follow below steps:-
1. Remove relation between trademarkdummy and factsales.
2. Add trademarks from trademarkdummy table into the slicer
3. Now update measure code as below:-
MultipliedProfit = VAR selected_value = SELECTEDVALUE ( TrademarksDummy[TradeMark] ) VAR mutiple = SELECTEDVALUE ( Multiplier[Value] ) RETURN IF ( NOT ( ISBLANK ( selected_value ) ) || NOT ( ISBLANK ( mutiple ) ), IF ( MAX ( factSales[TradeMark] ) IN VALUES ( TrademarksDummy[TradeMark] ), [ProfitPreTax] * mutiple, [ProfitPreTax] ), [ProfitPreTax] )You will see below output:-
And for getting correct total, you can create a another measure as below:-
with_Correct_Total = SUMX ( SUMMARIZE ( factSales, factSales[TradeMark], "total", Multiplier[MultipliedProfit] ), [total] )you can use it instead of MultipliedProfit measure but dont delete MultipliedProfit measure
Thanks,
Samarth
Samarth_18 , please find attached the pbix file
Hi shutevd ,
Please follow below steps:-
1. Remove relation between trademarkdummy and factsales.
2. Add trademarks from trademarkdummy table into the slicer
3. Now update measure code as below:-
MultipliedProfit =
VAR selected_value =
SELECTEDVALUE ( TrademarksDummy[TradeMark] )
VAR mutiple =
SELECTEDVALUE ( Multiplier[Value] )
RETURN
IF (
NOT ( ISBLANK ( selected_value ) ) || NOT ( ISBLANK ( mutiple ) ),
IF (
MAX ( factSales[TradeMark] ) IN VALUES ( TrademarksDummy[TradeMark] ),
[ProfitPreTax] * mutiple,
[ProfitPreTax]
),
[ProfitPreTax]
)
You will see below output:-
And for getting correct total, you can create a another measure as below:-
with_Correct_Total =
SUMX (
SUMMARIZE (
factSales,
factSales[TradeMark],
"total", Multiplier[MultipliedProfit]
),
[total]
)you can use it instead of MultipliedProfit measure but dont delete MultipliedProfit measure
Thanks,
Samarth