Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I am trying to sort data on my power BI report based on one column in one table based and date column from another table in , i wanted to know if there is a DAX function for sorting data in this way
Solved! Go to Solution.
But in that case wouldn't it just sort by Descending date?
I apologize for the questions, but I want to better understand to help you properly.
Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/
my syntax correct though?
What you will have to do is create a column that transforms the date into numeric code and sort by it.
12/01/2020 = 20201201
Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/
Hello, how are you?
I don't know if it's your case.
But if you have a date table and it is correctly related to your fact table.
Just go to Power Pivot, select your date table and sort the name of the month based on the numeric month column.
Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/
This is different from what i want to do, i dont have date table , but i do have table (fact) that has date column and another table (dim) that has the product ID. so i wanted to sort prodct ID based on the date
Could you share a sample of your data.
Or a fictional base.
Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/
Here, D is the date column, and P, is the product ID, in this screenshot, i would like say the 1/12/20 date and the product ID,s ending with 791 to be at the top
I understood.
My question is what would be the criterion that you will adopt based on the data to consider 139791 and 12/01/20 as the first item on the list.
After knowing this sorting logic, we have a route to follow.
Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/
Beacuase thats the newest date , it should be at the top
But in that case wouldn't it just sort by Descending date?
I apologize for the questions, but I want to better understand to help you properly.
Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/
I am trying to sort by that and i dont think i finding the place to do that, when i go to the model tab and select that column then try to sort, its not showing the output i need, its just showing all the date without any sort order
Create a custom column in Power Query:
= Table.AddColumn(#"Changed Type", "KeyId", each Text.Combine({Date.ToText([Date], "yyyy"), Date.ToText([Date], "%M"), Date.ToText([Date], "dd")}), type text)
then set this column as number:
Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/
I tried this code and my column shows "table"
--here is my code
Table.AddColumn(#"Changed Type", "KeyId", each Text.Combine({Date.ToText([orderdate], "yyyy"), Date.ToText([orderdate], "%M"), Date.ToText([orderdate], "dd")}), type text)
You can share a file with a faithful sample of your data so I can test it.
upload the file here: https://easyupload.io/
and send me the link.
Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
104 | |
94 | |
38 | |
30 |