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
Anonymous
Not applicable

Sorting error - can't be more than one value

Hi,

 

i try to sort the Slicer from Modeling pane >sort by column >sort by YearFinMonthDay (which is the year the month and the day) so there cannot be a duplicate.

But its giving me this error 'there can't be more than one value in yearfinmonthday for the same value in workweek.

 

Can a kind person please assist ?"

 

cheers 

1 ACCEPTED SOLUTION

It's a little tricky because we can't see the YearFinMonthDay values you have.

However, the error is caused because there are more than 1 value for YearFinMonthDay for one WorkWeek e.g. 29/ Mar/21 - 04/Apr/21 will have 5 values of YearFinMonthDay.  Powerbi doesn't know which to use.

 

You need to find something to order by that has the same granularity as WorkWeek, something like Year and weeknum combined OR Year and 1st Day of workweek combined.

That's my theory.

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

@Anonymous which column you are trying to sort? Does that is same as sort column?

 

For example,

 

you have 3 years dates in your calendar table and then you have month name column jan, feb march etc. so each month will repeat 3 times (1 for each year) and now sort column with 1, 2, 3, 4 (month number), so i this case you can sort month name with month number. Point here is that it doesn't need to be unique, but column you are sorting and column you are sorting by much have same value. hope I able to explain.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi, sorry can i please have some assistance ?

 

i've clicked on the column that i want sorting (workWeek) then i click 'sort by column', i chose YearFinMonthDay'.

YearFinMonthDay is in number format.

 

SortingSlicer.JPG

It's a little tricky because we can't see the YearFinMonthDay values you have.

However, the error is caused because there are more than 1 value for YearFinMonthDay for one WorkWeek e.g. 29/ Mar/21 - 04/Apr/21 will have 5 values of YearFinMonthDay.  Powerbi doesn't know which to use.

 

You need to find something to order by that has the same granularity as WorkWeek, something like Year and weeknum combined OR Year and 1st Day of workweek combined.

That's my theory.

It didnt work for me. I have unique items from an Excel sheet. In two PowerBI Report I am using this Excel sheet. In one PowerBI report the Sorting is working and the other one gives me an error. Also if I add an Index and sort it based on the Index.

Yvoro_0-1673448398645.png

 

Anonymous
Not applicable

thanks alot. that really clears things up.

i've manage to do it !

 

cheers,

 

workweeksort.JPG

Anonymous
Not applicable

Hi,

 

I'm sorry i dont understand.

I am trying to sort the Workweek, its data type is text.

i have concatenate a 'YearFinMonthDay' column which have the year/month/day.

so there should not be any duplicate value.

 

can you please assist ?

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.