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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
NithyaKB
Helper I
Helper I

Reg : Power BI Paginated Report builder (Parameter values with hiphen(-) not getting sorted)

Hi,
Please help me how to sort a number with dash in drop down values of a parameter in Power BI Paginated Report Builder.

NithyaKB_0-1660106646474.png

I have a column with hiphen as shown above.When I try sorting the column it gets sorted except for the double digit number after hiphen . 
For example in above screenshotthe values from 2021 - 9 till 2021 - 2 gets sorted descending order but 2021-10 , 2021-11, 2021-12 is not getting sorted . I need an output as below
2021-12
2021-11
2021-10
2021-9
2021-8
...

Below is the query for the parameter
EVALUATE SELECTCOLUMNS (ADDCOLUMNS (SUMMARIZECOLUMNS (ROLLUPADDISSUBTOTAL ('Query1'[periodfilter], "h0"), RSCustomDaxFilter(@Query1cmpcode,EqualToCondition,[Query1].[cmpcode],String)), "ParameterLevel", if ([h0], 0, 1)), "ParameterCaption", SWITCH([ParameterLevel], 1, "" & 'Query1'[periodfilter], "Blank()"), "ParameterValue", "" & 'Query1'[periodfilter], "ParameterLevel", [ParameterLevel], "'Query1'[periodfilter]", 'Query1'[periodfilter]) order by 'Query1'[periodfilter] DESC, [ParameterLevel]

2 REPLIES 2
Anonymous
Not applicable

Hi @NithyaKB ,

Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.

Best Regards

Anonymous
Not applicable

Hi @NithyaKB ,

Since the values are identified as Text type, they are in alphabetical order... Is it possible to change the drop down values with the below formats(when the month number is less than 10, then add the prefix "0")? 

2021-09

2021-08

2021-07

2021-06

2021-05

...

Best Regards

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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