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
Anonymous
Not applicable

Is this a bug or something? (Using IF, HASONEVALUE and BLANK functions)

I have a measure formula like this: IF(HASONEVALUE([column_name]) , SUM([other_column_name]) , BLANK() ), so it should give the sum of the other column when the current context is one row and give blank when the current context includes more than one row.

Though, when I add this measure to a visual, it doesn't allow me to include this measure in values. If I change "BLANK()" for 0 or 1, it plots the measure values without any problem. Why could this happen?

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , I am hopinh you are plotting it with column/axis/row of column_name .

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Also refer: https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

Anonymous
Not applicable

I can't share. I am plotting a Clustered column chart with a column of the same table (with repeated values) in the Axis well and the wanted measure in the Values well. When I set the measure value to  SUM([other_column_name] or 0, then it plots a column for every axis value, including those who are zero (and I actually don't want those to be showed); and when I set the measure value to SUM([other_column_name] or BLANK(), the chart doesn't support it. Why?

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.

Top Solution Authors