Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DagdasAlbag
Helper I
Helper I

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

 

DagdasAlbag_1-1649677478381.png

 

 

DagdasAlbag_0-1649677411448.png

thank you for the suppor!

 

1 ACCEPTED SOLUTION

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.

View solution in original post

3 REPLIES 3
Tahreem24
Super User
Super User

@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_)
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

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.

 

DagdasAlbag_0-1649837797904.png

 

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.