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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
JeffC
New Member

Week To Date accumulated Total not working on additional slicers

Good morning,

 

I have the table as below, and I tried to calculate the week to date sum for quantity.

 

The slicers for the table are:

Week

Product Category

Product Sub-category

 

I like to see when a user click on any specific week/weeks, week to date will sum from week 27 to the max of the selected week/weeks.

 

I have tried the below DAX:

 

Week to Date Qty = Calculate(
sum(Table[Quantity]),
Filter(All('Table'), 'Table'[Week] <= max('Table'[Week])))

 

but it doesn't filter on Product Category or Product Sub-category. I think it's the issue about that All('Table') part.

 

Could any one show me the correct Dax?

 

many thanks in advance.

 

 

 

WeekProduct CategoryProduct Sub-categoryQuantity
27AA15
27BB12
27AA21
27CC12
27CC24
28BB23
28BB11
28CC15
28AA12
28CC22
28AA13
28BB25
28BB13
29AA21
29CC12
29AA12
30AA23
30AA21
30BB25
30CC12
30BB12
30AA11
30CC23
30AA12
1 ACCEPTED SOLUTION

Picture3.png

 

Week to Date Qty =
CALCULATE (
[Qty Total],
FILTER ( ALL ( Weeks[Week] ), Weeks[Week] <= MAX ( Weeks[Week] ) )
)
 
 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Picture2.png

 

Qty Total =
SUM(Sales[Quantity])
 
 
Week to Date Qty =
CALCULATE (
[Qty Total],
FILTER ( ALLSELECTED ( Weeks[Week] ), Weeks[Week] <= MAX ( Weeks[Week] ) )
)
 
 
 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi, thanks so much for your reply.

 

The graph looks all good if the user highlight the weeks from the first week 27.

JeffC_0-1624852011418.png

 

Howerver, if a user pick week 28, I like the Week to Date stays the same as 38, instead of 24. 

Which means the Week to date number is always the sum of Wk27 to the max Wk that's been selected.

JeffC_1-1624852136847.png

 

Thanks in advance 🙂

 

 

 

Picture3.png

 

Week to Date Qty =
CALCULATE (
[Qty Total],
FILTER ( ALL ( Weeks[Week] ), Weeks[Week] <= MAX ( Weeks[Week] ) )
)
 
 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thanks so much for your help 🙂

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors