Forum Discussion
Calculate PreviousMonth doesnt work
- 8 years ago
In order to show the count of previous month's purchaseIDs on each row, you have to remove the relevant filter context using ALL:
Previous Month Purchase ID
= CALCULATE(
COUNT(PURCHTABLE[PURCHID])
, PREVIOUSMONTH('DATE'[Date])
, ALL(PURCHTABLE[PURCHID])
)
Does that table visual have any date context? I don't see anything obvious but maybe you've just used a filter. PREVIOUSMONTH returns the month prior to the first date in the given date context. It's not just automatically the month before today.
hI Anonymous,
Thanks , i didnt filter any date in a slicer. I just set a date in a slicer and now it give a total amount of the count of all purchId. which is 47.
But it didnt show me how much the purchid from the previous month on each row. Look at the image below. Any suggestions how i can show the numbers on each rows ?
- DAX01108 years agoResolver V
In order to show the count of previous month's purchaseIDs on each row, you have to remove the relevant filter context using ALL:
Previous Month Purchase ID
= CALCULATE(
COUNT(PURCHTABLE[PURCHID])
, PREVIOUSMONTH('DATE'[Date])
, ALL(PURCHTABLE[PURCHID])
)