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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
sshan21
New Member

Sort Order based on a dynamic parameter value

Hi

 

I have a parameter table with values as below.

sshan21_0-1723519581091.png

 

The Starting Date for each of these is different, example, YTD starts 1/Jan, Milk Season starts 1/Jun, Shipment Season starts 1/Aug and Fiscal Season starts 1/Oct.

 

Depending on which parameter, the user selects below, I want the line graph to change accordingly.

Example, if I select Shipment Season, the graph starts in August. However, when I change the Selection to Fiscal Season, I want it to change to start from October and so on..

sshan21_2-1723519788679.png

 

Any ideas?

 

Thanks

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sshan21 ,

I did a test for your reference,

Please check it.

Please write a measure, use the switch to determine the value selected by the slicer and the corresponding date range, and then put it in the visual filter to set it to 1.

Measure =

var _select=SELECTEDVALUE('Table'[Column2])

return

SWITCH(

    TRUE(),

    _select="YTD"&&MAX('Table 2'[Date])>=DATE(2024,1,1),1,

    _select="Milk Season"&&MAX('Table 2'[Date])>=DATE(2024,6,1),1,

    _select="Fiscal Season"&&MAX('Table 2'[Date])>=DATE(2024,10,1),1,0)

vyetonggumsft_0-1724643614549.png

vyetonggumsft_0-1724645556054.png

Best Regards,

Sunshine Gu

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @sshan21 ,

I did a test for your reference,

Please check it.

Please write a measure, use the switch to determine the value selected by the slicer and the corresponding date range, and then put it in the visual filter to set it to 1.

Measure =

var _select=SELECTEDVALUE('Table'[Column2])

return

SWITCH(

    TRUE(),

    _select="YTD"&&MAX('Table 2'[Date])>=DATE(2024,1,1),1,

    _select="Milk Season"&&MAX('Table 2'[Date])>=DATE(2024,6,1),1,

    _select="Fiscal Season"&&MAX('Table 2'[Date])>=DATE(2024,10,1),1,0)

vyetonggumsft_0-1724643614549.png

vyetonggumsft_0-1724645556054.png

Best Regards,

Sunshine Gu

Anonymous
Not applicable

Hi @sshan21 ,

Based on your screenshot, my understanding is that the order of the months on the x-axis of the line graph changes dynamically based on what you select in your slicer, is that correct? For example, if you select Fiscal Season, the x-axis order of your line chart would be October, November, December ......... ...July, August, and September, and the chart shows data from October 1, 2021 to the largest date in your data table, and data less than October 1, 2021 is no longer shown in the chart. Could you please confirm if my understanding is correct? As well as could you please provide sample data from another of your tables with date columns and value columns? Thanks!

If I've misunderstood you, please provide detailed sample data and the results you are hoping for. How to provide sample data in the Power BI Forum - Microsoft Fabric Community Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

 

Best Regards,

Sunshine Gu

Hi Sunshine

That is correct. 

If I select Fiscal Season, the chart should show data from october to september (next year).

If I select Shipment Season, the chart should show from August to July and so on.

 

Thanks

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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