Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I have a smartsheet with the reasons why people have left the company, more than 1 reason can be chosen from the list of 9 possible choices. I am trying to display the top 5 reasons on my dashboard.
I have created a measure for each of the 9 reasons to be able to count each time the individual reason is used -
Solved! Go to Solution.
Hi @CHCHJOSIE
You don't have to create a measure for each reason separately. You can add a table "Reason table" which has all distinct possible reasons to the model. Then there are three methods coming to my mind.
Method one:
Use Power Query to split the "Reason for leaving" column. When splitting, expand Advanced options and select split into Rows rather than the default Columns. All reasons will be splitted into the same column with only one reason on one row. Then it will be easy to be counted with DAX.
You can apply the change to power bi desktop, create a relationship between this table and the "Reason table" created earlier based on Reason column. This is a one-to-many relationship from "Reason table" to the original data table. Then create below measure. Add the reason column to a visual and add a TOP N filter on it based on the measure.
Method 2:
Use Power Query's Group by feature to count number of reasons after splitting the column into rows. Then apply a TOP N filter on the count column.
Method 3:
If you don't want to split the reason column, you can use the following measure:
Hi @v-jingzhang
Thanks so much for the different options and great explanations.
Option 3 seemed the easiest and being inherently lazy that was the one I chose and it worked perfectly!
😁
Hi @CHCHJOSIE
You don't have to create a measure for each reason separately. You can add a table "Reason table" which has all distinct possible reasons to the model. Then there are three methods coming to my mind.
Method one:
Use Power Query to split the "Reason for leaving" column. When splitting, expand Advanced options and select split into Rows rather than the default Columns. All reasons will be splitted into the same column with only one reason on one row. Then it will be easy to be counted with DAX.
You can apply the change to power bi desktop, create a relationship between this table and the "Reason table" created earlier based on Reason column. This is a one-to-many relationship from "Reason table" to the original data table. Then create below measure. Add the reason column to a visual and add a TOP N filter on it based on the measure.
Method 2:
Use Power Query's Group by feature to count number of reasons after splitting the column into rows. Then apply a TOP N filter on the count column.
Method 3:
If you don't want to split the reason column, you can use the following measure:
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
24 | |
12 | |
11 | |
11 | |
8 |
User | Count |
---|---|
43 | |
25 | |
15 | |
14 | |
12 |