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 have one more problem not getting the desired o/p:
I have dataset with two columns and need to create a table with Top 3 values then percentage of counts of respective values abd then need to calculate same with last 6 months.
Sample dataset
Date | B | C | ||
2022-05-18 | 8 | W | ||
2022-05-05 | 8 | W | ||
2022-04-05 | 8 | W | ||
2022-04-05 | 8 | W | ||
2022-01-05 | 8 | W | ||
2022-01-01 | 10 | W | ||
2022-01-24 | 8 | BL | ||
2022-01-10 | 8 | BL | ||
2022-01-01 | 8 | BL | ||
2022-03-27 | 6 | W | ||
2022-02-05 | 8 | W | ||
2022-01-26 | 8 | W | ||
2022-01-27 | 8 | GR | ||
2022-01-11 | 8 | W | ||
2022-05-03 | 8 | W | ||
2022-02-03 | 8 | W | ||
2022-04-18 | 6 | W | ||
2022-03-31 | 8 | W | ||
2022-05-16 | 8 | W | ||
2022-02-08 | 8 | W | ||
2022-01-06 | 6 | R | ||
2022-02-07 | W |
O/P -
Top 3 | B | B | B | C | C | C |
Type | 8 | 6 | 10 | W | BL | GR |
Percentage | ||||||
Percentage L6Months |
I have created a calculated column of different columns in seperate table
For Column B -
Solved! Go to Solution.
Hi @SK87 ,
I created a sample pbix file(get it from this link) for you, please check whether that is what you want. You can create measures as below to get it:
1. Create a measure as below to get the count of B
CountB =
CALCULATE (
COUNT ( 'Data'[B] ),
FILTER (
'Data',
'Data'[B] = SELECTEDVALUE ( 'Data'[B] )
&& NOT ( ISBLANK ( 'Data'[B] ) )
)
)
2. Create a measure as below to get the rank for B
RankB = RANKX ( ALLSELECTED ( 'Data'[B] ), [CountB],, DESC, DENSE )
3. Create a measure as below to get the percentage for B
PercentageB =
VAR _allcount =
CALCULATE (
COUNT ( 'Data'[B] ),
FILTER ( ALLSELECTED ( Data ), NOT ( ISBLANK ( 'Data'[B] ) ) )
)
RETURN
DIVIDE ( [CountB], _allcount, 0 )
4. Create a matrix visal and apply a visual-level filter with the condition ([RankB] is less than or equal to 3)
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @SK87 ,
I created a sample pbix file(get it from this link) for you, please check whether that is what you want. You can create measures as below to get it:
1. Create a measure as below to get the count of B
CountB =
CALCULATE (
COUNT ( 'Data'[B] ),
FILTER (
'Data',
'Data'[B] = SELECTEDVALUE ( 'Data'[B] )
&& NOT ( ISBLANK ( 'Data'[B] ) )
)
)
2. Create a measure as below to get the rank for B
RankB = RANKX ( ALLSELECTED ( 'Data'[B] ), [CountB],, DESC, DENSE )
3. Create a measure as below to get the percentage for B
PercentageB =
VAR _allcount =
CALCULATE (
COUNT ( 'Data'[B] ),
FILTER ( ALLSELECTED ( Data ), NOT ( ISBLANK ( 'Data'[B] ) ) )
)
RETURN
DIVIDE ( [CountB], _allcount, 0 )
4. Create a matrix visal and apply a visual-level filter with the condition ([RankB] is less than or equal to 3)
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
User | Count |
---|---|
16 | |
15 | |
14 | |
12 | |
11 |
User | Count |
---|---|
19 | |
15 | |
14 | |
11 | |
9 |