Forum Discussion
Help counting rows based on previous month date
- 6 years ago
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/ - 6 years ago
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
- v-eachen-msft6 years agoCommunity Support
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.