Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Egrofal
Helper I
Helper I

Sort table by date

Hi,

 

I am using Power Bi for my company, and have to create dashbord with several table sorted by date,

I got a date picker table and some other tables. And on these tables I would like to sort all my datas by date (ascending). For that I added a column date and sort the table by this column. But the problem is that I have ta add the date on all my tables, and it's not really usefull and would like to delete this column (but if I do that my table are not sort by date anymore). 

 

So my question is : Is-it possible to sort my table day the ascending date, even if I don't add this column in my tables ? 

 

Thanks for your help,

Valentin

1 ACCEPTED SOLUTION

So to help people who got the same problem, the best way to resolve it at the moment is to place the column on the right of the board, go to the focus mode and hide it on the left

On this way my table's tab looks like that :

 Capture d’écran 2016-09-30 à 14.49.23.png

So Date is hiden, (you just see a small part of the tab)

 

It's not perfect, but I don't have any idea to do better...

View solution in original post

22 REPLIES 22
Egrofal
Helper I
Helper I

no idea ?

@Egrofal

 

If you want the cost column to be sorted by day column, you need to first select the cost column and then click “Sort By Column” - “date_days” as below.

 

Sort table by date_2.jpgSort table by date_3.jpgSort table by date_1.jpg

 

Best Regards,

Herbert

Hi Herbert,

 

Thanks for your answer,

I tried but when I select the column "cost" then sort it by "date" I have a error message :

 

"We cannot sort the 'cost' column by 'date_day'. You can't have more than one value in 'date_day' for the same value in 'cost'. Choose a different column for sorting or update the data in 'date_day'.

Yeah, I've seen that one and it can be frustrating. Perhaps if you create a new column with Date and a random timestamp you could get some unique values for sorting purposes. I think you would have to create that column in your Query however in Power Query "M" language as I do not believe that DAX has a RANDOM function.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
BhaveshPatel
Community Champion
Community Champion

 

As you have shown in the screenshot, you can not sort this table by dates without adding the date column in your table or in other words, you have to have a date column in your table to sort your data by dates.

 

Hope this has clarified your understanding.

 

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

You might be able to go into your data model and choose the Modeling tab and then set the "Sort By Column" for one of your other columns to be the Date column.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Still not work...
Apparently, the reason is that I have several same value on my colomn "cost"

Oh yeah, nevermind, duh. The issue is that it wants a 1:1 relationship between the two columns. So, yeah, that was a dumb suggestion on my part. Hmm. Thinking...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks to try 😉

 

In the worst case, if it's not possible to sort my table  by date without deleting my column date. 

Do you think that it would be possible to just hide this column (like on excel) in my table vizualisation ?

You can *nearly* hide it. If it is in a table, you can hover your mouse over the column header edge and drag it to near nothingness.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Yes, I did that but it's not a really good solution... But thanks @Greg_Deckler

Yeah, sorry; I agree, but I think you are stuck with it for now.

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

So to help people who got the same problem, the best way to resolve it at the moment is to place the column on the right of the board, go to the focus mode and hide it on the left

On this way my table's tab looks like that :

 Capture d’écran 2016-09-30 à 14.49.23.png

So Date is hiden, (you just see a small part of the tab)

 

It's not perfect, but I don't have any idea to do better...

Thanks for your help, but I am not able to do this, like you can see on the following screenshot 

 

Capture d’écran 2016-09-29 à 14.51.49.png

You need to go into your data model (middle icon on left) and then select your table and then select your column and then Sort By Column should activate.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Yes, I also did this, but even like that when I delete the column "date" , the table is shorting by the "cost"

Not sure, here is an example of a Value sorted by Date without Date in the visual, just Value sorted by Date.

 

ValueByDate.png


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks OK, it seems working on your graph, but for me it's not.

 

Maybe, I did something wrong....

 

Here, some screeenshots :

 

My Data model sorted by day : Capture d’écran 2016-09-29 à 15.25.06.png

 

My values of my report table : Capture d’écran 2016-09-29 à 15.25.54.png

 

 

My report table with the date (so it's correctly sorted) : Capture d’écran 2016-09-29 à 15.25.45.png

 

 

 

Then, I delete the column "date"Capture d’écran 2016-09-29 à 15.26.05.png

 

 

And my final report table (who is not sorted correctly anymore) : Capture d’écran 2016-09-29 à 15.26.15.png

 

 

Anyway, thanks for your help, I appreciate 🙂

BhaveshPatel
Community Champion
Community Champion

Yes but you can only sort the individual visual and not the entire dataset. 

 

To do so, follow this steps,

 

  1. Select the ellipses (...) in your visual and choose Sort by > Dates.

  2. If necessary, select the sort icon  to change to Descending or Reverse for Ascending.

 

Thanks & Regards,

Bhavesh

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Thanks for your answer, 

Ok but when I select the ellipses in my visual, I don't have the possibility to choose Sort By > Dates.

 

Like you can see on one of my table, when I am selecting the elipse, I can only choose : Export Data or Remove.

 

So I can't do your solution, 

To remind I want to have the table, sorted like on the screen shot but i don't want to keep the column "Day". But if I delete it, it's gonna be sorted by the second column "CPC"

Capture d’écran 2016-09-29 à 12.21.59.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.