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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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