Forum Discussion
joshua1990
Post Prodigy
4 years agoCALCULATE SUM for specific range
Hi experts! I have a calendar, a dimensional and a transactional table. Then I have a matrix that is filtered for the current week. This matrix shows me the sales for the current week. In additio...
- 4 years ago
joshua1990 Well, you could find the last Saturday by doing something like this:
Measure = VAR __Calendar = ADDCOLUMNS(CALENDAR(TODAY()-7,TODAY()),"__Weekday",WEEKDAY([Date],2)) VAR __LastSaturday = MINX(FILTER(__Calendar,[__Weekday]=6),[Date]) RETURN CALCULATE([someting],ALL('Dates'),'Dates'[Date]>=__LastSaturday,'Dates'[Date]<=TODAY())
joshua1990
Post Prodigy
4 years agoGreg_Deckler : Thanks a lot! How can the range be specified in the function? Any logic that you can share here?
Greg_Deckler
Community Champion
4 years agojoshua1990 Well, you could find the last Saturday by doing something like this:
Measure =
VAR __Calendar = ADDCOLUMNS(CALENDAR(TODAY()-7,TODAY()),"__Weekday",WEEKDAY([Date],2))
VAR __LastSaturday = MINX(FILTER(__Calendar,[__Weekday]=6),[Date])
RETURN
CALCULATE([someting],ALL('Dates'),'Dates'[Date]>=__LastSaturday,'Dates'[Date]<=TODAY())