Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
premm
New Member

How to get a value from one column based on an expression in another column.

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

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

 

Picture1.png

 

Percentage =
AVERAGEX( Data, Data[Tot Logged Effort]/Data[Expected Effort])
 

 

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 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
premm
New Member

thanks JiHwan Kim,

 

its working fine for me.

 

 

Remi_Bouvier
Frequent Visitor

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.

Remi_Bouvier_0-1624689352125.png

You can change the ALLSELECTED to VALUES in PercBSU variable to get "Cloud" only showing up on the cloud row.

 

 

Jihwan_Kim
Super User
Super User

 

Picture1.png

 

Percentage =
AVERAGEX( Data, Data[Tot Logged Effort]/Data[Expected Effort])
 

 

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 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.