Forum Discussion
DAX- Date
I am getting data for the last 7th day (Displays 29th Dec data as today is Jan 5th)using the below DAX
Hello sshiny,
The measure that you wrote is a scalar value and will give you only one value.
From what I have understood, you need to filter the calendar table using something like this:
FILTER('Calendar', Calendar[Date] >= Today() - 7 && Calendar[Date] <= Today() )
This will give a table of the Last 7 days or you can write a measure something like this
Count = CALCULATE(COUNTROWS('Calendar'), FILTER('Calendar', Calendar[Date] >= Today() - 7 && Calendar[Date] <= Today() ))Hope this helps.
Thank you,
Vishesh Jain
2 Replies
- visheshjainImpactful Individual
Hello sshiny,
The measure that you wrote is a scalar value and will give you only one value.
From what I have understood, you need to filter the calendar table using something like this:
FILTER('Calendar', Calendar[Date] >= Today() - 7 && Calendar[Date] <= Today() )
This will give a table of the Last 7 days or you can write a measure something like this
Count = CALCULATE(COUNTROWS('Calendar'), FILTER('Calendar', Calendar[Date] >= Today() - 7 && Calendar[Date] <= Today() ))Hope this helps.
Thank you,
Vishesh Jain
- Mahesh0016Super User
sshiny
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.