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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
ManjunathaEP
Helper II
Helper II

Total not showing for Measure

Hi, Thank you in advance for helping me to solve with DAX for the below sample.

ManjunathaEP_1-1618580878445.png

 

I calculated the measures:

1. Sales = SUM(Data[Sales])
2. Sales previous year =
VAR currentyear = MAX(Years[Year])
RETURN
CALCULATE( [Sales], Years[Year] = currentyear-1)
4. Diff = [Sales]-[Sales previous year]
3. lost = IF(-[Diff]=[Sales previous year],[Diff],BLANK()) 
I got the results without "Totals" and I would like to get the totals for the below table
ManjunathaEP_2-1618581071584.png

Also, I did not get the results by Year for the measure selection of "Lost" as shown in the below screenshot.

ManjunathaEP_3-1618581213482.png

Please help me on this.

 
1 REPLY 1
Anonymous
Not applicable

@ManjunathaEP 

 

I'll give you a hint: You should use the standard building blocks of Power BI, not invent your own. Please read this first Time Intelligence in Power BI Desktop - SQLBI. Each sensible model should have a proper Date table as a dimension. If you don't need to expose a set of columns from it, you can hide them. But you should use what you've been given out of the box.

 

Now, why the heck would you write code like this: -[Diff]=[Sales previous year]? Since [Sales]-[Sales previous year] = [Diff], is it not simpler and more understandable to just write [Sales] = 0? Why would you want to complicate simple things?

 

Last thing... If you want to also have totals, you have to sum up the quantities of interest over the set of visible customers.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.