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
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

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
Super User
Super User

Hi @bjurek 

 

You can use ISINSCOPE

 

 

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

 

it is not working 😞

bjurek_0-1690287188080.png

 

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 ? 

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 😞 

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

 

It is a measure, not a calculated column

bjurek_0-1690292139241.png

 

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

 

mlsx4_0-1690293122007.png

 

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.