Forum Discussion

Jorritster's avatar
Jorritster
Frequent Visitor
4 years ago
Solved

Context issue when adding measure to a table

Hi all,   I am creating a model in which I check whether our customers have reached a particular Threshold in a particular country. If this happens we have to report for them more extensively. Ther...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Jorritster ,

    I updated the sample pbix file provided by tamerj1 (see attachment), please check if that is what you want...

    1. Change the cross filter direction as Both

    2. Update the formula of measure [Threshold_Passed] as below

    Threshold_Passed =
    VAR YTDTaxable =
    [YTD_TaxableBasis]
    VAR Threshold =
    CALCULATE (
    SUM ( 'Thresholds'[Threshold] ),
    FILTER('CDM','CDM'[Direction]=SELECTEDVALUE('Direction'[Direction]))   // CROSSFILTER ( CDM[Direction], Direction[Direction], BOTH )
    )
    VAR Result =
    IF (
    YTDTaxable > Threshold,
    "TRUE",
    IF (
    NOT ISBLANK ( Threshold ),
    "FALSE"
    )
    )
    RETURN
    Result

    Best Regards