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

Removing total value in report

How can I remove total value in  report with following dax code:

 

select_identity:=

Var identity = CALCULATE(FIRSTNONBLANK(VALUES('identity'[identity description]);1))
Var identitydb= CALCULATE(FIRSTNONBLANK(VALUES('identitydb'[identitydb description]);1))

Var Result= SWITCH(
TRUE();

identity = Blank();identitydb;
identity 
)

Return IF(HASONEVALUE('Fact_table'[identitykey]) && HASONEVALUE('Fact_table'[identitydbKey]);Result;BLANK())

 

I've changed columnname.

I've two dimension tables (identity och identitydb) which has relation to fact table(Fact_table). If one of columns 'identity description' and 'identitydb description' is null it will return the value of the other. It works fine if one of them is null but it doesn't work when both of them has value and shows value in total in report. 

 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@Anonymous 

You can use ISINSCOPE for this.

The measures I'm using in this example are:

1) your calculation

Switch = 
VAR Identity = MAX('Sample'[Identity])
VAR dbident = MAX('Sample'[Indetitydb])
RETURN
IF(
ISBLANK(Identity),
dbident,  
Identity)

2) Measure to remove total:

Remove total = IF(ISINSCOPE('Sample'[Index]), [Switch])

 

To get his:

result.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

6 REPLIES 6
PaulDBrown
Community Champion
Community Champion

@Anonymous 

You can use ISINSCOPE for this.

The measures I'm using in this example are:

1) your calculation

Switch = 
VAR Identity = MAX('Sample'[Identity])
VAR dbident = MAX('Sample'[Indetitydb])
RETURN
IF(
ISBLANK(Identity),
dbident,  
Identity)

2) Measure to remove total:

Remove total = IF(ISINSCOPE('Sample'[Index]), [Switch])

 

To get his:

result.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

@Anonymous , you want to remove always or any ?

Return IF(HASONEVALUE('Fact_table'[identitykey]) || HASONEVALUE('Fact_table'[identitydbKey]);Result;BLANK())

Anonymous
Not applicable

Thank you @amitchandak  I want to remove it always, in the following screenshot I want to remove 'Fabric chocolate AB in Total row:

 

22.PNG

 

I tested with '||' but it still returns the value and shows 'identity discription' in Total row.

@Anonymous , I think this how be driven by is there in row or matrix or table. Are these two columns are also in the row of matrix/table

 

Anonymous
Not applicable

@amitchandak 

It's a simple table in report .

Yes, the column is in the table (in report) and the column name is 'Identity description' and depending to which one ('identity' or 'identitydb') is NULL it would show value to the one which is not NULL.

@Anonymous Did @PaulDBrown 's suggestion work? Seems like the way to go.


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

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