Forum Discussion

shutevd's avatar
shutevd
Frequent Visitor
5 years ago
Solved

Ignore Slicer and multiply by selected value

Hi guys,   I am struggling with the following scenario: I have a table that contains product names, next to it I have a column that contains the Sales before Tax. My client wants to be able to s...
  • Samarth_18's avatar
    Samarth_18
    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