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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

DAX measure not showing totals

Hi I have created a Current Week Sales measure for my sales report but for some reason the measure does not show total at the bottom. I looked for answers online, and I see most of the solutions recommend to wrap the dax measure within SUMX. I tried doing that but for some reason it did not work, may be I did not apply it properly as I am still learning dax. 

 

I would apprecieate if someone could help me figure out this issue - 

 

Measure:

Current Week Sales 

CALCULATE([Qty],
  FILTER(ALL(DateDimension),
  DateDimension[WeekNum] = SELECTEDVALUE(DateDimension[WeekNum]) &&
  DateDimension[Year] = SELECTEDVALUE(DateDimension[Year])))
 
Rabin_1-1669048474344.png

 

 

Thank you in advance 


 

 
 
1 ACCEPTED SOLUTION
djurecicK2
Super User
Super User

@Anonymous ,

 Here is how I did it:

Create 2 measures:

QTY = SUM(Sales[Sales])
QTY Last Year = CALCULATE([QTY],SAMEPERIODLASTYEAR(DateTable[Date]))
 
Result in table visual:
djurecicK2_1-1669070826835.png

 

You do not need to calculate the value for each week, just use the measure QTY. Adding Year and Week to the visual gives context to the measure so only that week or same week last year will be shown.

 

sample data:

djurecicK2_0-1669070745044.png

 

 

View solution in original post

7 REPLIES 7
djurecicK2
Super User
Super User

Also you can get variance like this:

QTY Variance = [QTY]-[QTY Last Year]
djurecicK2_2-1669071125638.png

 

 
djurecicK2
Super User
Super User

@Anonymous ,

 Here is how I did it:

Create 2 measures:

QTY = SUM(Sales[Sales])
QTY Last Year = CALCULATE([QTY],SAMEPERIODLASTYEAR(DateTable[Date]))
 
Result in table visual:
djurecicK2_1-1669070826835.png

 

You do not need to calculate the value for each week, just use the measure QTY. Adding Year and Week to the visual gives context to the measure so only that week or same week last year will be shown.

 

sample data:

djurecicK2_0-1669070745044.png

 

 

Anonymous
Not applicable

Can anyone please help me?

djurecicK2
Super User
Super User

Ok, you might take a look at using sameperiodlastyear in conjunction with the qty measure.  

 

https://learn.microsoft.com/en-us/dax/sameperiodlastyear-function-dax

Anonymous
Not applicable

I have tried this. The sameperiodlastyear function works with dates, but for my result I am using weeks and need the result to sum by weeks (which I am able to achive as you can see in the screenshot), but I also need totals to show up at the bottom. That's the only issue I am having - measure not showing up in Total


djurecicK2
Super User
Super User

Hi @Anonymous ,

 This is because there is no SELECTEDVALUE(DateDimension[WeekNum]) or SELECTEDVALUE(DateDimension[Year]) in the totals line. If you want to test this, create a separate measure with either of those 2 values and add it to the table or matrix.

 

It seems like Qty is working fine- what are you looking to achieve by creating another measure?

Anonymous
Not applicable

I am using Qty to validate numbers against Current Week Sales. My ultimate goal is to create Current Week Sales, Same Week Last Year measure and Same Week Last Year Variance (SWLY Variance) to compare current week vs same week last year numbers. I am able to get the correct numbers at row level for both measures but they are not showing up in totals.

 

I created separate measures for SELECTEDVALUE(DateDimension[WeekNum]) and SELECTEDVALUE(DateDimension[Year]) as YearTest and WeekTest.

 

Do I need to update DAX on Current Week Sales too, and add YearTest and WeekTest to the logic? 

 

Current Week Sales 

CALCULATE([Qty],
  FILTER(ALL(DateDimension),
  DateDimension[WeekNum] = SELECTEDVALUE(DateDimension[WeekNum]) &&
  DateDimension[Year] = SELECTEDVALUE(DateDimension[Year])))

Rabin_0-1669054634300.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.