Forum Discussion
Previous Month without filter
- 8 years ago
Hi,
please provide Sample PBIX.
THX
Hi,
I hope, posting a link like this is ok:
I created two measures:
CountLastMonth = CALCULATE(COUNT(Invoices[InvNr]);DATEADD(DateTable[Date].[Date];-1;MONTH))
CountPreviousMonth = CALCULATE(COUNT(Invoices[InvNr]);PREVIOUSMONTH(DateTable[Date].[Date]))
Many thanks!
- WolfBiber8 years agoMicrosoft Employee
Hey,
easiest way is just to add another measure:
CountPreviousMonthFromToday = CALCULATE([CountPreviousMonth];DateTable[Date]= Today())
The reason is that Powerbi doesnt know for a single value what is the last passed month. Your Measure
CountPreviousMonth = CALCULATE(COUNT(Invoices[InvNr]);PREVIOUSMONTH(DateTable[Date].[Date]))
returns a table.
For correct function of measure
CountPreviousMonthFromToday
you have to extend your date table to minimun until today.
Hope it helps.
Greetings.
- WolfBiber8 years agoMicrosoft Employee
CountPreviousMonth = CALCULATE(COUNT(Invoices[InvNr]);PREVIOUSMONTH(DateTable[Date]))
sorry, there was a 'Date' to much :D
find correct formula above
- legrand8 years agoHelper I
Hi,
now it shows me the table as a result but the final measure is still blank :smileysad:
Many thanks!
- legrand8 years agoHelper I
Hi,
thanks for the explanation. I tried your solution but the new measure still shows blank. I attached the modified PBIX.
Many thanks!