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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
MDivyanjali
Frequent Visitor

change the table order based on a dynamic slicer values

Hi,

I created a calculated table with two values, 'Yes' and 'No', to be used in a slicer. I have a table called 'ATL' with a column named 'orderDate' that contains product order dates. I would like to sort the 'ATL' table in ascending order by the 'orderDate' column when 'Yes' is selected from the previously created slicer.

Could anyone assist me with achieving this?

Thank You.

1 ACCEPTED SOLUTION
Jpss
Resolver II
Resolver II

Here is my Approach to it :
Step 1 -  I created two date tables One with dates sorted in Asc order, another one with Dates sorted in Desc Order. 

Step 2 - create a relationship between Date Column of these date tables with the Date column in Fact table . In your Case ATL table ( order Date Column ) 

Step 3 - Create a Field parameter,  add date Columns from both date tables ( that we created in step 1)
Step 4 - in the Dax of field Parameters, also add another column Values "Yes" and "NO",   - these will be used to build a relationship with your calculated table that you are using as a slicer.  Alternatively you can use this column as a slicer itself 

In the following code you can see how to add the Yes and No , to create a new column for field parameter table that gets created.

Jpss_4-1726648342778.png

 




Step 5 Create a relationship between your slicer table and field parameter. 

Here is how the data model will look like

Jpss_0-1726647786764.png

 

Step 6 - Now When creating the Matrix Visual, instead of using dates from date tables or fact tables, Add Field parameter to the rows

Jpss_1-1726647885906.png

Step 7 Create the Yes / No Slicer. 
that should give you required results. 

Jpss_2-1726647999918.pngJpss_3-1726648029240.png

 

I hope this helps.
and I am curious if someone else over here has a different approach to this scenario




View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi,

The reply Jpss offers should be helpful. 

 

Best Regards,

Wisdom Wu

Jpss
Resolver II
Resolver II

Here is my Approach to it :
Step 1 -  I created two date tables One with dates sorted in Asc order, another one with Dates sorted in Desc Order. 

Step 2 - create a relationship between Date Column of these date tables with the Date column in Fact table . In your Case ATL table ( order Date Column ) 

Step 3 - Create a Field parameter,  add date Columns from both date tables ( that we created in step 1)
Step 4 - in the Dax of field Parameters, also add another column Values "Yes" and "NO",   - these will be used to build a relationship with your calculated table that you are using as a slicer.  Alternatively you can use this column as a slicer itself 

In the following code you can see how to add the Yes and No , to create a new column for field parameter table that gets created.

Jpss_4-1726648342778.png

 




Step 5 Create a relationship between your slicer table and field parameter. 

Here is how the data model will look like

Jpss_0-1726647786764.png

 

Step 6 - Now When creating the Matrix Visual, instead of using dates from date tables or fact tables, Add Field parameter to the rows

Jpss_1-1726647885906.png

Step 7 Create the Yes / No Slicer. 
that should give you required results. 

Jpss_2-1726647999918.pngJpss_3-1726648029240.png

 

I hope this helps.
and I am curious if someone else over here has a different approach to this scenario




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.