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.
I have a table with three columns as mentioned below, I have created a Measure to get the percentage Tot Loged Effort and Expected Effort.
I want to create a measure to get the ”Base Service Unit” name based on maximum percentage in “Percentage Logged/Expected" (this is a Measure)“
desire output should be Cloud as it has maximum percentage.
I would like to create a measure.
Base Service Unit | Tot Logged Effort | Expected Effort | Percentage Logged/Expected (Measures) |
Cloud | 16036.85 | 17468 | 92% |
Data | 5708.33 | 6336 | 90% |
Digital | 17221.17 | 19170 | 90% |
Digital-2 | 5579 | 6372 | 88% |
regards,
premm bissht
Solved! Go to Solution.
MAX percentage Base Service Unit =
VAR maxpercentage =
SUMX (
KEEPFILTERS ( TOPN ( 1, ALL ( Data[Base Service Unit] ), [Percentage], DESC ) ),
[Percentage]
)
RETURN
CALCULATE (
SELECTEDVALUE ( Data[Base Service Unit] ),
FILTER ( ALL ( Data[Base Service Unit] ), [Percentage] = maxpercentage )
)
https://www.dropbox.com/s/slxsr4ezftnx3ru/premm.pbix?dl=0
thanks JiHwan Kim,
its working fine for me.
Hi,
Can you try the below measure please?
Base Service Unit max =
VAR PercBSU =
ADDCOLUMNS(
ALLSELECTED('Table'[Base Service Unit]),
"@Percentage",[Percentage Logged/Expected]
)
Var MaxPerc =
MAXX(
ALLSELECTED('Table'[Base Service Unit]),
[Percentage Logged/Expected]
)
VAR Result =
CALCULATE(
MAX('Table'[Base Service Unit]),
FILTER(PercBSU, [@Percentage] = MaxPerc)
)
RETURN
Result
I am able to return the correct output.
You can change the ALLSELECTED to VALUES in PercBSU variable to get "Cloud" only showing up on the cloud row.
MAX percentage Base Service Unit =
VAR maxpercentage =
SUMX (
KEEPFILTERS ( TOPN ( 1, ALL ( Data[Base Service Unit] ), [Percentage], DESC ) ),
[Percentage]
)
RETURN
CALCULATE (
SELECTEDVALUE ( Data[Base Service Unit] ),
FILTER ( ALL ( Data[Base Service Unit] ), [Percentage] = maxpercentage )
)
https://www.dropbox.com/s/slxsr4ezftnx3ru/premm.pbix?dl=0
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |