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
Debbs1976
Frequent Visitor

Is blank giving wrong total

Hi guys,

 

I've got a table and I only want to show the sum of one measure if another measure is not equal to zero.

 

I've created a calculation...

 

 

if(
      ISBLANK([COLUMN A]),

      BLANK(),

sum(COLUMN B))

 

 

 

Now obviously the total row is greater than zero so in the column B Total it is doing a sum on ALL of the values in column B.

 

Is there anyway I can amend the formula to allow for the fact Grand Total should only sum what is displayed?

 

Any help will be greatly appreciated.

 

Ta

 

 

3 REPLIES 3
v-huizhn-msft
Employee
Employee

@Debbs1976


You’d better to add a filter in sum() function when you create a calculation based on your requirement. I create below calculated column using sample data and formula, please review it.

=IF(ISBLANK(Sale[Sale Date]),BLANK(),CALCULATE(SUM(Sale[Sale ]),ALLEXCEPT(Sale,Sale[Sale Date])))

11.png

 

Best Regards,
Angelia

Sean
Community Champion
Community Champion

DAX Measure = CALCULATE ( SUM(Table[Column B]), Table[Column A] = BLANK() )
Or
DAX Measure = CALCULATE ( SUM(Table[Column B]), Table[Column A] = "" )
CheenuSing
Community Champion
Community Champion

Hi @Debbs1976

 

Can you share some data and the visual you are expecting.

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

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.