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
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
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.