Forum Discussion

DagdasAlbag's avatar
DagdasAlbag
Helper I
4 years ago
Solved

Dax function "IF"

Hello all,

 

how do I get the last two columns in row 3 (year: 2020) without values?

It should look like on the picture 2.

 

Unfortunately it does not work with the following Dax function:

Abw. in % = IF([Aufträge VJ],DIVIDE('Measure'[Abw. in Stk. (Aufträge)],
[Aufträge VJ],BLANK()))*100

 

 

 

thank you for the suppor!

 

  • Hi, DagdasAlbag 

     

    Column names can't be used directly in measure, you need to use aggregate functions like max() min() selectedvalue() etc....

    Like this:

    RETURN IF(selectedvalue(table[Year])=2020, BLANK(),result_)

     

     Best Regards,
    Community Support Team _ Janey
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • DagdasAlbag TRy this:

    Measure =
    VAR result_ = IF
    ([Aufträge VJ],DIVIDE('Measure'[Abw. in Stk. (Aufträge)],[Aufträge VJ],BLANK()))*100
    RETURN IF(Year=2020, BLANK(),result_)
     
    • DagdasAlbag's avatar
      DagdasAlbag
      Helper I

      Unfortunately I get the following error message:
      No single value can be determined for the "Year" column in the "DimDate" table. This can happen when a measure formula refers to a column with many values without specifying an aggregation such as MIN, MAX, COUNT or SUM to get a single result.

       

       

      • v-janeyg-msft's avatar
        v-janeyg-msft
        Community Support

        Hi, DagdasAlbag 

         

        Column names can't be used directly in measure, you need to use aggregate functions like max() min() selectedvalue() etc....

        Like this:

        RETURN IF(selectedvalue(table[Year])=2020, BLANK(),result_)

         

         Best Regards,
        Community Support Team _ Janey
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.