Forum Discussion

gmasta1129's avatar
gmasta1129
Resolver I
1 year ago
Solved

If Statement on a Measure

Hello,    I created a measure that looks at the distinct count of a column with text.     Measure = DISTINCTCOUNT(Table_Name[Investment_fund_name])   The output produced is a number.    I wou...
  • v-achippa's avatar
    1 year ago

    Hi gmasta1129,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    Based on the requirement, please use this below measure it will give either 6 or 0 based on the total number of distinct funds, regardless of the table or visual context where it is used:

     

    Measure = VAR DistinctFundCount = CALCULATE(

        DISTINCTCOUNT(Table_Name[Investment_fund_name]),

        REMOVEFILTERS(Table_Name)

    )

    RETURN

    IF(DistinctFundCount > 20, 6, 0)

     

    If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

     

    Thanks and regards,

    Anjan Kumar Chippa