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
Praj
Helper I
Helper I

How to lookup unique keys which has multiple values

Hello Everyone,

 

I am trying to lookup for keys which has multiple values in the table. 

 

For example, 

Below is my source table, where contract start is the date when the contract started for the user and the review date is the date when the user reviewed his/her service.

Praj_0-1671713103468.png

 

I am trying to findout the review date for each user based on when it occured. For example, User 1 had two reviews, one within 90 days of contract date and other was during 90 and 180 days of contract. Below is my output table I created manually. 

 

Praj_1-1671713229001.png

 

I am trying to find out if there is any DAX formulas to calculate these. Any help is appreciated. 

 

TIA

Cheers,

Praj

 

1 ACCEPTED SOLUTION
TomasAndersson
Solution Sage
Solution Sage

Hi!

You can add some filter conditions with DATEDIFF() too only look at a certain period, for example:

 

 

ReviewDateBetween90-180Days = 
CALCULATE(
    Max('Table'[Review Date]),
    ALLEXCEPT('Table','Table'[User]), //Look at all entries for the specific user
    DATEDIFF('Table'[Contract Start],'Table'[Review Date],DAY) >= 90 &&
    DATEDIFF('Table'[Contract Start],'Table'[Review Date],DAY) < 180
)

 

 

Note that this finds the latest (MAX()) review date within each period. If there can be several reviews for the same user within the same period, you might have to modify something.

 

Hope this helps!

View solution in original post

1 REPLY 1
TomasAndersson
Solution Sage
Solution Sage

Hi!

You can add some filter conditions with DATEDIFF() too only look at a certain period, for example:

 

 

ReviewDateBetween90-180Days = 
CALCULATE(
    Max('Table'[Review Date]),
    ALLEXCEPT('Table','Table'[User]), //Look at all entries for the specific user
    DATEDIFF('Table'[Contract Start],'Table'[Review Date],DAY) >= 90 &&
    DATEDIFF('Table'[Contract Start],'Table'[Review Date],DAY) < 180
)

 

 

Note that this finds the latest (MAX()) review date within each period. If there can be several reviews for the same user within the same period, you might have to modify something.

 

Hope this helps!

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.