Forum Discussion
Catch the 7 Days with data
Hello,
I've trying to build a Line Clustered Column Chart that shows the 7 days (columns) with data, if it doesn't have data does not count. I'd appreciate any ideas.
My codes:
SHARED AXIS =
Gabe_07 , In case you use want last seven days, use relative date slicer.
https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range
In case you want to have with date use.
https://www.youtube.com/watch?v=duMSovyosXE
or like
Rolling 7 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX(Sales[Sales Date]),-7,Day))
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/
See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184
Appreciate your Kudos.Hi Gabe_07 ,
If the dates are not continuous,you'd better use TOPN function to first calculate the top 7 dates which is ahead of the selected dates.Then you will get the sum value you need.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
3 Replies
- amitchandak
Super User
Gabe_07 , In case you use want last seven days, use relative date slicer.
https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range
In case you want to have with date use.
https://www.youtube.com/watch?v=duMSovyosXE
or like
Rolling 7 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX(Sales[Sales Date]),-7,Day))
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/
See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184
Appreciate your Kudos.- Gabe_07
Helper I
amitchandak Sorry for the delay, I found your replies awesome that gave me ideas to improve the pages. I created an slicer with 4 periods of time. Thank you
v-kelly-msft Thank you for your solution kelly, that was the main idea with the Line and Clustered column Chart
- v-kelly-msft
Community Support
Hi Gabe_07 ,
If the dates are not continuous,you'd better use TOPN function to first calculate the top 7 dates which is ahead of the selected dates.Then you will get the sum value you need.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!