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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
A_S
Frequent Visitor

Matching a value in a range of values

Hello, 

 

I am working on a system to check data on certificates that have been sent to customers to issue to students. My issue is that the certificates are sold in books of 25 and only the min and max number of each book is recorded in the sales records. 

 

I am looking to create a column which pulls the Customer Reference Number for an individual certificate by examining the two columns (min value and max value) and determining when it is in between those values. 

 

I'm not sure if I have explained this very well but I have attached a github link below to my dummy pbi file and dummy data. 

 

https://github.com/A-S-1/Dummy-Data-and-PBI/find/main

 

Please let me know if you need more information and thanks for reading. 

 

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@A_S,

 

Try this calculated column in the Certificates table :

 

Customer Reference Number = 
VAR vCertNum = Certificates[Certificate number]
VAR vTable =
    FILTER (
        Orders,
        vCertNum >= Orders[Min Cert number]
            && vCertNum <= Orders[Max Cert number]
    )
VAR vResult =
    MAXX ( vTable, Orders[Customer Reference] )
RETURN
    vResult

 

DataInsights_0-1624636188675.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
A_S
Frequent Visitor

Brilliant, thank you for your help.

DataInsights
Super User
Super User

@A_S,

 

Try this calculated column in the Certificates table :

 

Customer Reference Number = 
VAR vCertNum = Certificates[Certificate number]
VAR vTable =
    FILTER (
        Orders,
        vCertNum >= Orders[Min Cert number]
            && vCertNum <= Orders[Max Cert number]
    )
VAR vResult =
    MAXX ( vTable, Orders[Customer Reference] )
RETURN
    vResult

 

DataInsights_0-1624636188675.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors