DAX running total using 'Calendar' table that respects filter context,

dicken

Active Member
Joined
Feb 12, 2022
Messages
292
Office Version
  1. 365
Platform
  1. Windows
I hope I've got my row / filer the the right way round,

I created two measures one using the dates from the fact table the other from the calendar table

SQL:
RTM using C = VAR mcdate = MAX('Calendar'[Date]) 
VAR anser = CALCULATE([Tsales],FILTER(ALL('Calendar'[Date]),'Calendar'[Date]<= mcdate)) 
RETURN IF([Tsales],anser )

and the same but rather than using calendar table using the dates form the fact table

SQL:
RTM using Rsaels Date = 
VAR maxdate = MAX(RTsales[Date])
VAR anser2 = CALCULATE([Tsales],FILTER(ALL(RTsales[Date]),RTsales[Date]<= maxdate)) 
VAR iff = IF([Tsales], anser2 )

they both work on their respective matrix's 'matrices'? , but when another element is dropped in
the matrix using the calendar still returns a running total by date ignoring the current 'row', so as can be seen March 7th returns 42, correct in both cases but
for the 'calendar' not exactly what i want, any suggestion on making it work properly,, like the second one. ignore RTM using C just dropped in to see what would happen.
1657628129503.png
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I hope I've got my row / filer the the right way round,

I created two measures one using the dates from the fact table the other from the calendar table

SQL:
RTM using C = VAR mcdate = MAX('Calendar'[Date])
VAR anser = CALCULATE([Tsales],FILTER(ALL('Calendar'[Date]),'Calendar'[Date]<= mcdate))
RETURN IF([Tsales],anser )

and the same but rather than using calendar table using the dates form the fact table

SQL:
RTM using Rsaels Date =
VAR maxdate = MAX(RTsales[Date])
VAR anser2 = CALCULATE([Tsales],FILTER(ALL(RTsales[Date]),RTsales[Date]<= maxdate))
VAR iff = IF([Tsales], anser2 )

they both work on their respective matrix's 'matrices'? , but when another element is dropped in
the matrix using the calendar still returns a running total by date ignoring the current 'row', so as can be seen March 7th returns 42, correct in both cases but
for the 'calendar' not exactly what i want, any suggestion on making it work properly,, like the second one. ignore RTM using C just dropped in to see what would happen.
View attachment 69103
 
Upvote 0
Please ignore this , it is working, I don't know why I thought it wasn't.
Rd
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top