Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I am using direct query of the table. need help on the custom sorting on the name and also count # of records where name = "High" (just for example)
The table has following columns.
Key | Name |
1 | High |
2 | High |
3 | High |
4 | Low |
5 | Low |
6 | Low |
7 | Low |
8 | Medium |
9 | Medium |
10 | Medium |
11 | High |
12 | Low |
13 | Medium
|
The output should be displayed as ( manual sort )
Name | Count |
High | 4 |
Medium | 4 |
Low | 5 |
How do I accomplish this using SWITCH ?
Solved! Go to Solution.
@Anonymous , Create a new column in Power Query and Then In Column Tools(DAX) mark it sort column=
=
If [Name] ="High" then 1
else if [Name] ="Medium" then 2 else 3
In case you want this DAX
Create a new column first
Name 1 = [Name]
Then create Sort column
Name Sort = Switch(True() ,
[Name] ="High" ,1,
[Name] ="Medium" ,2 ,3 )
Then mark Name Sort as sort column of Name 1 and use name 1 in visual
How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c
@Anonymous , Create a new column in Power Query and Then In Column Tools(DAX) mark it sort column=
=
If [Name] ="High" then 1
else if [Name] ="Medium" then 2 else 3
In case you want this DAX
Create a new column first
Name 1 = [Name]
Then create Sort column
Name Sort = Switch(True() ,
[Name] ="High" ,1,
[Name] ="Medium" ,2 ,3 )
Then mark Name Sort as sort column of Name 1 and use name 1 in visual
How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |