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
lilych
Helper II
Helper II

Best way to remove % change total from table

Hello -

 

What is the best way to remove the % Change total from the table? I tried to use HASONEVALUE() bt it doesn't seem to be working. 

 

Measure:

% Change = IF(NOT ISBLANK([# Cases]),DIVIDE([YoY Difference], [# Case LY]))

 

lilych_0-1596733678375.png

 

Thank you

7 REPLIES 7
v-eachen-msft
Community Support
Community Support

Hi @lilych ,

 

Try the following measure and check if it works.

% Change =
VAR a =
    IF ( NOT ( ISBLANK ( [# Cases] ) ), DIVIDE ( [YoY Difference], [# Case LY] ) )
RETURN
    IF ( ISINSCOPE ( 'Table'[Month] ), a, BLANK () )

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Thanks @v-eachen-msft . When I try that measure, it returns no data - see %Change TEST below.

 

lilych_0-1596820845364.png

 

Greg_Deckler
Super User
Super User

@lilych - So you did HASONEVALUE on month column for example?

 

Measure:

% Change =
  VAR __Value = IF(NOT ISBLANK([# Cases]),DIVIDE([YoY Difference], [# Case LY]))
RETURN
  IF(HASONEVALUE([Month]),__Value,BLANK())
 
You can also count all the rows you in your table COUNTROWS(ALL('Table')) store it in a variable. Then do a COUNTROWS('Table'). If they match, you are in the Total line.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler . When I used the HASONEFILTER, it returns all blanks (see TEST % Change) which has the measure you outlined. Not sure why this is happening.

lilych_0-1596736720191.png

 

@lilych - HASONEVALUE, not HASONEFILTER. Also could try ISINSCOPE, Also, could do:

 

Measure 

<blah blah blah>

VAR __CountAll = COUNTROWS(ALL('Table')

VAR __Count = COUNTROWS('Table')

RETURN

  IF(__Count = __CoutAll,BLANK(), <something else>)


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler  - I meant HASONEVALUE, not HASONEFILTER, and it returned all blanks. I've tried ISINSCOPE can't seem to figure that out either. I'm new to DAX and will continue try to find out how to make this work. 

 

Could it be that it is still calculating the % CHange of the grand total, which is why it isn't working?

 

Thanks for the help

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.