Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hey all,
In our Org we report 1 month in arrers. So I need to write a DAX measure that looks for "recorded date" for the previous month.
Im not sure what if any functions there are in PBI that evaluates current month? I need something to the effect of...
Last month Total = Countrows(This month - 1)
Thanks,
J
Solved! Go to Solution.
@Anonymous , Try with date table
MTD Sales = CALCULATE(countrows(Sales[Table]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(countrows(Sales[Table]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Hi @Jaydpie ,
First, you must create a relationship between the fact table and the date dimension.
Next, create the above measures in the file.
Here is my test file for your reference.
@Anonymous , Try with date table
MTD Sales = CALCULATE(countrows(Sales[Table]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(countrows(Sales[Table]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Hey,
Not sure where to apply these? I have a date table and my data has a "date claim reported" column.
I am a noob to PBI
Hi @Jaydpie ,
First, you must create a relationship between the fact table and the date dimension.
Next, create the above measures in the file.
Here is my test file for your reference.
User | Count |
---|---|
77 | |
76 | |
41 | |
30 | |
24 |
User | Count |
---|---|
96 | |
91 | |
53 | |
47 | |
46 |