Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I'm wondering is there any method to sort "Date Range" column?
Please kindly find the pbix file:
https://www.dropbox.com/s/s9da9ce3jimw1ko/Date.pbix?dl=0
Solved! Go to Solution.
Hi @YunJ ,
I would replace that column by another one see below codes for DAX and Power query:
Power Query:
Date.ToText([Start], "yyyy/MM/dd") & "-" &Date.ToText([End], "yyyy/MM/dd")
DAX:
FORMAT(Sheet2[Start];"yyyy/mm/dd") & "-"&FORMAT(Sheet2[End];"yyyy/mm/dd")
This will give you the dates with double digits in month and day so the order should be correct.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @YunJ,
You need to have double digits on both day and month in order to get 01-01 otherwise the order will be incorrect change your format from M/D to MM/DD should do the trick
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @YunJ ,
Please try like this:
Rank Start = RANKX(Sheet2,Sheet2[Start],,ASC,Skip)
Hi @YunJ ,
I would replace that column by another one see below codes for DAX and Power query:
Power Query:
Date.ToText([Start], "yyyy/MM/dd") & "-" &Date.ToText([End], "yyyy/MM/dd")
DAX:
FORMAT(Sheet2[Start];"yyyy/mm/dd") & "-"&FORMAT(Sheet2[End];"yyyy/mm/dd")
This will give you the dates with double digits in month and day so the order should be correct.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @MFelix
I wrote the DAX as following:
But the x-axis order is not in the correct sort.
Thanks for your time.
Hi @YunJ ,
Please try like this:
Rank Start = RANKX(Sheet2,Sheet2[Start],,ASC,Skip)
Hi @YunJ,
You need to have double digits on both day and month in order to get 01-01 otherwise the order will be incorrect change your format from M/D to MM/DD should do the trick
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |