Forum Discussion
Create table with relative dates from slicer
- Anonymous5 years ago
Hi nicksinclair01 ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Create a date dimension table
2. Create 3 measures as below to get daily count, the count for prior 5 days and the count for prior 20 days
Daily Count = CALCULATE(SUM('Table'[Count]),FILTER('Table','Table'[Date]=SELECTEDVALUE('Date'[Date])))Prior 5 Days = CALCULATE(SUM('Table'[Count]),DATESBETWEEN('Table'[Date],SELECTEDVALUE('Date'[Date])-5,SELECTEDVALUE('Date'[Date])))Prior 20 Days = CALCULATE(SUM('Table'[Count]),DATESBETWEEN('Table'[Date],SELECTEDVALUE('Date'[Date])-20,SELECTEDVALUE('Date'[Date])))You can aslo refer the following video to get it.
Show Days Before Or After A Selected Date - Advanced Power BI Visual Techniques
If the above ones are not what you want, please provide your expected result with backend logic and specific examples. Thank you.
Best Regards
Hi nicksinclair01 ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Create a date dimension table
2. Create 3 measures as below to get daily count, the count for prior 5 days and the count for prior 20 days
Daily Count = CALCULATE(SUM('Table'[Count]),FILTER('Table','Table'[Date]=SELECTEDVALUE('Date'[Date])))Prior 5 Days = CALCULATE(SUM('Table'[Count]),DATESBETWEEN('Table'[Date],SELECTEDVALUE('Date'[Date])-5,SELECTEDVALUE('Date'[Date])))Prior 20 Days = CALCULATE(SUM('Table'[Count]),DATESBETWEEN('Table'[Date],SELECTEDVALUE('Date'[Date])-20,SELECTEDVALUE('Date'[Date])))
You can aslo refer the following video to get it.
Show Days Before Or After A Selected Date - Advanced Power BI Visual Techniques
If the above ones are not what you want, please provide your expected result with backend logic and specific examples. Thank you.
Best Regards