Forum Discussion
Parameter ASC or DESC
I've created parameter taken from data table column i.e. Year, Quarter and those parameter I am using as Slicer.
then I created Line chart using parameter as X Axis. line chart 3 dot option i changed ASC / DESC and saved.
Issue : if i click on slicer it will not give ASC / DESC order in line chart X Axis, suggest how to fix it
Thanks!
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.
4 Replies
- brsamyrmoisesFrequent Visitor
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!- adudaniMemorable 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.
- v-kpoloju-msftCommunity Support
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.- v-kpoloju-msftCommunity Support
Hi Anonymous,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.Thank you.