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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
rmocca
Helper I
Helper I

Find a row by value between two columns

Hi,

I hope you all doing great.

I tell you my problem.

I have a measure that returns de CPK of a data table.

 

I have another table with categories, like this:

CodeMinMax
A01
B12
C23

 

I need to make another measure that takes the current CPK value, and check the Code when the CPK is between Min and Max.

 

Is this possible?

 

Thanks in advance.

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

This measure will return the Code based on the CPK result.  It assumes there is no relationship to the Code table.

 

CPK Code = var thisCPK = [YourCPKMeasure]

return calculate(MIN(Code[Code]), Code[Min]<= thisCPK, Code[Max]>= thisCPK)

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

This measure will return the Code based on the CPK result.  It assumes there is no relationship to the Code table.

 

CPK Code = var thisCPK = [YourCPKMeasure]

return calculate(MIN(Code[Code]), Code[Min]<= thisCPK, Code[Max]>= thisCPK)

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Your are correct, there is not relation with the Code table.

I'm going to try this and let you know

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.