Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi Guys,
I tried to calculate the total purchase id from table PurchTable from the previous month.
My current measure is:
Previous Month Purchase ID = CALCULATE(COUNT(PURCHTABLE[PURCHID]), PREVIOUSMONTH('DATE'[Date]))
Unfortunatly it doesnt show the result...
This is the relationship between Date table and PurchTable.
Any suggestion?
Thanks in advances.
Rega Sanyoto
Solved! Go to Solution.
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.
Proud to be a Super User!
hI @KHorseman,
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 ?
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])
)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.