Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.