Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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.
Solved! Go to Solution.
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.
Step 5 Create a relationship between your slicer table and field parameter.
Here is how the data model will look like
Step 6 - Now When creating the Matrix Visual, instead of using dates from date tables or fact tables, Add Field parameter to the rows
Step 7 Create the Yes / No Slicer.
that should give you required results.
I hope this helps.
and I am curious if someone else over here has a different approach to this scenario
Hi,
The reply Jpss offers should be helpful.
Best Regards,
Wisdom Wu
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.
Step 5 Create a relationship between your slicer table and field parameter.
Here is how the data model will look like
Step 6 - Now When creating the Matrix Visual, instead of using dates from date tables or fact tables, Add Field parameter to the rows
Step 7 Create the Yes / No Slicer.
that should give you required results.
I hope this helps.
and I am curious if someone else over here has a different approach to this scenario
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
76 | |
57 | |
36 | |
34 |
User | Count |
---|---|
99 | |
56 | |
56 | |
46 | |
40 |