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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bjurek
Helper I
Helper I

HASONEVALUE problem

in the Power BI Dekstop program, I have 4 columns that I place in the matrix visualization.
I put Year column, Month column and Day column in rows and Value column in values.
Would like to not show the sum of the values ​​for the IValue column when the columns are collapsed. Unfortunately, after collapsing the columns, the sums for the columns appear and I don't want that. I have used the HASONEVALUEe function as below but the sum still appears.

IF(HASONEVALUE(Table_Name[Year]), Table_Name[Value], BLANK())


bjurek_0-1690287535679.png

 

 

 

 

1 ACCEPTED SOLUTION
mlsx4
Memorable Member
Memorable Member

I have exactly the same but Year, Month and Day are text type:

 

mlsx4_0-1690293122007.png

 

View solution in original post

12 REPLIES 12
mlsx4
Memorable Member
Memorable Member

Hi @bjurek 

 

You can use ISINSCOPE

 

 

sumSc = SWITCH(
    TRUE(),
    ISINSCOPE('Table'[Day]),SUM('Table'[IndeksVisible]),
    BLANK()
)

 

it is not working 😞

bjurek_0-1690287188080.png

 

mlsx4
Memorable Member
Memorable Member

But where are your rows?

 

mlsx4_0-1690287439912.png

 

Sometimes i need colaps Month=1 and i dont want show sum of value for Month=1. Can you do it ? 

mlsx4
Memorable Member
Memorable Member

If you write a "", it will keep the value visible:

mlsx4_2-1690288274972.png

 

 

Columns which i grouping are: Year, Month, Day. 
Value column is: Value
Table with Year,Month,Day nad Value is Table_Name. 

Maybe I make some wrong with name of columns or table. I dont know 😞 

mlsx4
Memorable Member
Memorable Member

But if you do this, doesn't it work?

sumSc = SWITCH(
    TRUE(),
    ISINSCOPE('Table'[Day]),SUM('Table'[IndeksVisible]),
    ""
)

 

Dear mlsx4,

thank you for your suggestion of ISINSCOPE function. I was struggling with HASONEVALUE in case where there was only one value in one group, while I wanted to show the value only on total rows. You saved my mind!

Best regards,

Monika

no value 😞 

bjurek_0-1690290022482.png

 

mlsx4
Memorable Member
Memorable Member

It is a measure, not a calculated column

bjurek_0-1690292139241.png

 

mlsx4
Memorable Member
Memorable Member

I have exactly the same but Year, Month and Day are text type:

 

mlsx4_0-1690293122007.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.