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 September 15. Request your voucher.

Reply
FJME
Helper I
Helper I

Order a slicer based in a measure

Dear colleagues!

 

In a auto production industry dashboard i created a new measure (DefeitosResumo) to count the defects (TotalDefects) by type (Defects), based in the column Defects from FIS table. After it, i created a slicer with the type of defects (Defeitos) but i can't order it by quantity of defects, although i ordered previously (in TotalDefeitos column measure). I think that is not possible to order it as derive from a measure. Can you help with some workaround ?

Best regards

 

Francisco

2 ACCEPTED SOLUTIONS

The only problem is that it lacks the axis ordenation in the slicer . My apology and thanks for all the efforts. Best regards. FE

View solution in original post

Can you accept our reply as solution if it helps




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

11 REPLIES 11
FJME
Helper I
Helper I

Hi bhanu!

 

I finnaly was able to create the functions recommended. However when i created the slicer, it simply order the defects alphabetically and i can´t order it (descendently) by the total of defects. Best regards. FE

 

FJME_0-1720113769339.png

 

Anonymous
Not applicable

Hi,

Thanks for the solution @bhanu_gautam  provided, and i want to offer some more information for user to refer to.

hello @FJME , after you creating the defectcounts table, you can click the defect column, then select sort by TotalDefects column, you can refer to the following picture.

 

vxinruzhumsft_0-1720146280697.png

Then sort the totaldefect column ascending/descending, then put the defect field to the slicer, it can work.

If the solutions @bhanu_gautam  and i offered help you solve the problem, please consider to mark them as solutions.

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

The only problem is that it lacks the axis ordenation in the slicer . My apology and thanks for all the efforts. Best regards. FE

Can you accept our reply as solution if it helps




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Good morning!

The situation remains. I tried one more time follow the instructions (please see next image)

FJME_0-1720172959410.png

but when i create the slicer in report view, he turns to alphabetical order as you can see in picture below...

FJME_1-1720173064335.png

Best regards

FE

FJME
Helper I
Helper I

Bhanu !

 

Unfortunately i can't surpass the sort order step (after created the table). How can i send you the .pbi ? Best regards. Thanks. FE

FJME_0-1720109778677.png

 

bhanu_gautam
Super User
Super User

@FJME , First create a calculated table that includes defect types

DefectCounts =
SUMMARIZE(
FIS,
FIS[Defects],
"TotalDefects", COUNT(FIS[Defects])
)

 

Then create a measure for Sorting

SortOrder =
RANKX(
ALL(DefectCounts),
[TotalDefects],
,
DESC,
DENSE
)

 

Select the DefectCounts table in the Fields pane.
Click on the Defects column.
Go to the Column tools tab and click on Sort by Column.
Select the SortOrder measure.


Create the Slicer
Create a slicer using the DefectCounts table.

Go to the Report view.


Add a slicer visual to the report.
Drag the Defects column from the DefectCounts table to the slicer.
Use the Slicer to Filter the Data
Use the slicer to filter the data in your report.

Add the necessary visuals to your report.
Use the slicer to filter the data based on the defect types.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hi Bhanu! Thanks by your rapid answer. However PBI informs is not possible determine the value of TotalDefects as the colunm don't exists or don't exists no actual line for that column. Best regards

FJME_0-1720096180853.png

 

@FJME , first use this and create new calculated column 

DefectCounts =

SUMMARIZE(

FIS,

FIS[Defects],

"TotalDefects", COUNT(FIS[Defects])

)

 

This is creating new column totaldefects using summarise function 

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






..but ate not the some instructions used above to create the "calculated table"?

Yes it is I think measure is not correctly defined, create below measure

 

     TotalDefects = COUNT(FIS[Defects])
 
Then calculated column 
DefectCounts =
SUMMARIZE(
FIS,
FIS[Defects],
"TotalDefects", [TotalDefects]
)
 
Then a measure for sorting
SortOrder =
RANKX(
ALL(DefectCounts),
[TotalDefects],
,
DESC,
DENSE
)
 
Try this approach if you still face some issue share sample data



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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.