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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

how to make measure that uses blank() to appear for Total

I have the following measure:

Dollars =
VAR GivenMonthRelative = MIN('Dimension Date'[Month Relative Label])

RETURN
IF(
    GivenMonthRelative = "Current Month"
    ,BLANK()
    ,SUM('Fact'[Cost])
)

 

The purpose of the code beyond the simple SUM('Fact'[Cost]) expression is to make the measure not appear for the current month on a visual that uses 'Dimension Date'[Month Relative Label].  I have this measure (and a few other measures) on a table visual that also has [Month Relative Label] as a dimension.  When I turn on Totals for the table, this measure's Total value is not appearing.  How can I make its Total value appear?

 

For reference, when I re-define the measure as simply Dollars = SUM('Fact'[Cost]), the measure Total value appears.  So, it must have something to do with the BLANK() expression, but I don't know how to resolve it.

 

7 REPLIES 7
Anonymous
Not applicable

 

// Do this:

Dollars =
CALCULATE(
	sum( Fact[Cost] ),
	KEEPFILTERS(
		'Dimension Date'[Month Relative Label] <> "Current Month"
	)
)

 

 

... and be done with it. The other solutions are not only overly complex. They are also slower than this one. The one above is about as good as it can get.

 

Best

D

jdbuchanan71
Super User
Super User

@Anonymous 

Try changing your VAR to use SELECTEDVALUE instead of MIN.

VAR GivenMonthRelative = SELECTEDVALUE('Dimension Date'[Month Relative Label])

RETURN
IF(
    GivenMonthRelative = "Current Month"
    ,BLANK()
    ,SUM('Fact'[Cost])
)
Anonymous
Not applicable

@jdbuchanan71 
Even though this solution enables the Total value to appear, it includes the current month's value.  I don't want the Total to include the current month's value.  Sorry that I didn't make this clear in my original post.

Although in my test your original measure works correctly for the total row:

2020-05-14_12-59-01.jpg

Hi guys,
I am struggling the same issue.  Although i change the data as Blank, total value include the original value.
If you solved/understand the issue, your help is much appreciable.

 

Thanks

az38
Community Champion
Community Champion

Hi @Anonymous 

try to use SUMX. smth like

Dollars =
VAR GivenMonthRelative = MIN('Dimension Date'[Month Relative Label])

RETURN
SUMX('Fact',
IF(
    GivenMonthRelative = "Current Month"
    ,BLANK()
    ,SUM('Fact'[Cost])
)
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 

This solution didn't work.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors