cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IzuruWi
Frequent Visitor

Display day wise on X axis in stacked bar chart.

I'm creating a stacked bar chart to show the day's sales values. To input starting date for the chart, a calendar slicer has been added. My requirement is once, the user has selected a starting date, the chart should display the dates starting from the selected date whether data is available or not. I have tested whether this can be rectified by changing the X-axis type from "Categorial" to "Continous". But it won't do any, to achieve the requirement.
I have below attached a sample chart that I have created.

IzuruWi_0-1685620608883.png

 

Also, I need to set the ending date automatically by adding 6months to the starting date. I think the relative date option won't work since the user is selecting starting date from a calendar. Calendar slicer settings have been set as "After" and I need to set the end date to complete the requirement.


I'm really greatful you guys can help me with this.. 

 

 

1 REPLY 1
amitchandak
Super User
Super User

@IzuruWi , Use After and control rest in measure

 

new measure =
var _min= Minx(allselected(Date),Date[Date])
var _max= eomonth(_min, 5) // ot use 6 
return
calculate( sum(Table[Value]), filter('Date',  'Date'[Date] <=_max))

 

Helpful resources

Announcements
Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors