Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculated Column IF Amount Exceeds Dynamic Threshold

Hi,  I am pretty new to Power BI, but I have the formula below to identify records that need Review by checking if the calculated Difference exceeds a Threshold. This formula works if I use it in a ...
  • v-chenwuz-msft's avatar
    4 years ago

    Hi Anonymous 

    You want to create a column but the column is calculated to change dynamically, right?

    This seems to be impossible in Power Bi due to the difference between the measure and the calculated column. Columns are calculated and saved in the capture as soon as you create it, so the result in column won’t change when you do something on slicer.

    But you can try to use measure to show the result which defined to display based on the slicer

    Variance_check =
    VAR Difference =
        CALCULATE( SUM( 'TB DATA'[Sales] ), 'TB DATA'[Period] = "CurrentYear" )
            - CALCULATE( SUM( 'TB DATA'[Sales] ), 'TB DATA'[Period] = "PriorYear" )
    RETURN
        IF( ABS( Difference ) > Threshold[Value], "Review", BLANK() )
    

     

    Then unselect show items no data

    the result will behind the rows with blank。

     

    Best Regards

    Community Support Team _ chenwu zhu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.