Forum Discussion
Parameter ASC or DESC
- 1 year ago
Hi Anonymous,
Thank you for reaching out to the Microsoft fabric community forum. Thank you adudani, brsamyrmoises, for your inputs on this issue.
After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.Create Date Parameter Dax:
DateParameter =
DATATABLE(
"Year", INTEGER,
"Quarter", STRING,
"YearQuarter", STRING,
"SortOrder", INTEGER,
{
{2023, "Q1", "2023 Q1", 202301},
{2023, "Q2", "2023 Q2", 202302},
{2023, "Q3", "2023 Q3", 202303},
{2023, "Q4", "2023 Q4", 202304},
{2024, "Q1", "2024 Q1", 202401},
{2024, "Q2", "2024 Q2", 202402}
}
)
Create Sales Data Dax:
SalesData =DATATABLE(
"YearQuarter", STRING,
"Sales", INTEGER,
{
{"2023 Q1", 100},
{"2023 Q2", 150},
{"2023 Q3", 130},
{"2023 Q4", 180},
{"2024 Q1", 160},
{"2024 Q2", 200}
}
)
Relationship should be for both tables – Many to One Relationship:
To adjust the x-axis values, please select either the sort ascending or sort descending option.
I am also including .pbix file for your better understanding, please have a look into it:
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
Hi Raj!
Check if the Sort By Column feature address your need.
If need any help with that -> Video from Curbal : Custom sort order for axis, columns, legends.... in Power BI - YouTube
Documentation: Sort one column by another column in Power BI - Power BI | Microsoft Learn
If you need any help, let me know!
Take care!
- adudani1 year agoMemorable Member
hi Anonymous ,
brsamyrmoises thank you for your reply. this solution should work as per my understanding.
However, Anonymous you would need to keep this into account while creating dax measure though while removing filters etc. depending on the context transition.
Alternatively, another reference : Never do Sort by Column Again!
if this doesn't resolve the issue, kindly provide a sample input masking sensititve data and a sample output.