The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I'm looking for your help to create the measure for the below table
Date | Badge | Total |
31/08/2021 | A | 95.5 |
31/08/2021 | A | 98.2 |
30/08/2021 | B | 91.2 |
31/08/2021 | B | 93.3 |
31/08/2021 | B | 96.4 |
30/08/2021 | C | 95.5 |
30/08/2021 | D | 98.2 |
30/08/2021 | E | 91.2 |
28/08/2021 | F | 93.3 |
29/08/2021 | F | 96.4 |
I want to calculate the count of distinct badges based on the below conditions average value.
a) Distinct count of badge based on Average value above 90
b) Distinct count of badge based on Average value between 90 to 75
c) Distinct count of badge based on Average value below 75
I'm going to use the "Date" as a slicer. if I'm I select a particular date from the slicer, it shows the distinct count of badges based on the average value condition.
For example, the output for 31/08/2021 is
1) > 90 = 2
2) 90 -75 = 1
3) < 75 = 1
Solved! Go to Solution.
Hi Sakthi,
Thanks for clarifying.
Measure1 =
VAR MyTable =
SUMMARIZE (
'Table',
'Table'[Badge],
"Average Score", AVERAGE ( 'Table'[Total] )
)
RETURN
SUMX ( MyTable, 0 + ( [Average Score] > 90 ) )
Measure2 =
VAR MyTable =
SUMMARIZE (
'Table',
'Table'[Badge],
"Average Score", AVERAGE ( 'Table'[Total] )
)
RETURN
SUMX ( MyTable, ( [Average Score] >= 75 ) * ( [Average Score] <= 90 ) )
Measure3 =
VAR MyTable =
SUMMARIZE (
'Table',
'Table'[Badge],
"Average Score", AVERAGE ( 'Table'[Total] )
)
RETURN
SUMX ( MyTable, 0 + ( [Average Score] < 75 ) )
Regards
Glad to know! Cheers.
Hi Sakthi,
Thanks for clarifying.
Measure1 =
VAR MyTable =
SUMMARIZE (
'Table',
'Table'[Badge],
"Average Score", AVERAGE ( 'Table'[Total] )
)
RETURN
SUMX ( MyTable, 0 + ( [Average Score] > 90 ) )
Measure2 =
VAR MyTable =
SUMMARIZE (
'Table',
'Table'[Badge],
"Average Score", AVERAGE ( 'Table'[Total] )
)
RETURN
SUMX ( MyTable, ( [Average Score] >= 75 ) * ( [Average Score] <= 90 ) )
Measure3 =
VAR MyTable =
SUMMARIZE (
'Table',
'Table'[Badge],
"Average Score", AVERAGE ( 'Table'[Total] )
)
RETURN
SUMX ( MyTable, 0 + ( [Average Score] < 75 ) )
Regards
Thank you Jos.. Really it is working perfectly.
Hi,
Can you clarify? Your posted data only has values greater than 90, so I'm confused as to how you could ever arrive at an average less than 90 from that dataset.
Regards
Hi Jos,
Sorry for the confusion. please find below the corrected dataset.
Date | Badge | Total |
31/08/2021 | A | 95.5 |
31/08/2021 | A | 98.2 |
30/08/2021 | B | 91.2 |
31/08/2021 | B | 93.3 |
31/08/2021 | B | 96.4 |
31/08/2021 | C | 80.2 |
31/08/2021 | C | 85.2 |
30/08/2021 | D | 98.2 |
30/08/2021 | E | 91.2 |
28/08/2021 | F | 93.3 |
31/08/2021 | F | 74.2 |
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |