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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
randika118
Helper I
Helper I

Line Chart dynamic X-Axis based on Month and Year Slicers

Hi All,

I have a line chart and I want to add a dynamic

Img.png

"date range" x-axis so, Start Date should be based on the column Max Value and End Date Should be Based selected Slicer Value

So, I tried to change the "Range" of X-Axis in Line Chart Properties. 
Start Date Ok. but for the End Date, I calculated the date measure based on the slicers, but it didn't work out.

can you help?


 

Thanks,

 

1 ACCEPTED SOLUTION

Hi , @randika118 

I think the @amitchandak  Dax code is right .

I test it in my side ,this is my test data:

vyueyunzhmsft_0-1683179606458.png

We need to put the 'Calendar'[Date].[Year] and [Month] on the slicer and we use this Measure:

Measure = 
var _slicer = maxx(allselected('Calendrier'), 'Calendrier'[Date])
return
_slicer

 

And we configure it in the X-axis:

vyueyunzhmsft_1-1683179671550.png

 

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

5 REPLIES 5
randika118
Helper I
Helper I

It doesn't work out

Hi , @randika118 

I think the @amitchandak  Dax code is right .

I test it in my side ,this is my test data:

vyueyunzhmsft_0-1683179606458.png

We need to put the 'Calendar'[Date].[Year] and [Month] on the slicer and we use this Measure:

Measure = 
var _slicer = maxx(allselected('Calendrier'), 'Calendrier'[Date])
return
_slicer

 

And we configure it in the X-axis:

vyueyunzhmsft_1-1683179671550.png

 

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Thank you. It works. 

amitchandak
Super User
Super User

@randika118 , Have you tried a measure like ?

 

maxx(allselected(Date), Date[Date])

Hi. No, i will try. 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.