Forum Discussion
Anonymous
6 years agoNot applicable
Column Bar Chart Split from the same data?
Good morning. I am working on a chart with some crime data. My boss would like a column chart showing crime data for the previous day and the current day, but he would also like to see a comparison...
- 6 years ago
Hi Anonymous ,
First, create an unrelated calendar table as slicer.
DimDate = ADDCOLUMNS(CALENDAR("20/04/2020","28/05/2020"),"week", WEEKNUM([Date]))Create measures to filter data from previous week and previous day.
last_day = IF(MAX('Table'[date])<=SELECTEDVALUE(DimDate[Date])&&MAX('Table'[date])>=SELECTEDVALUE(DimDate[Date])-1,1,0)Last Week = VAR CURRENT_WEEK = SELECTEDVALUE(DimDate[week]) VAR CURRENT_YEAR = YEAR(SELECTEDVALUE(DimDate[Date])) RETURN IF(MAX('Table'[week])<=CURRENT_WEEK&&MAX('Table'[week])>=CURRENT_WEEK-1&&YEAR(MAX('Table'[date]))=CURRENT_YEAR,1,0 )Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
V-lianl-msft
6 years agoCommunity Support
Hi Anonymous ,
Yes, you need to create a measure and apply it to the visual level filter as the picture show.
You can refer to .pbix for more details.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
6 years agoNot applicable
Hi there. I did open the sample file...but still do not know where I would be adding those formulas your provided.