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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Get Limit value from table 2 by comparing date from table 1

Hi,

I have 2 tables like below:

 

Onkar__22_0-1690179236849.png

 

Onkar__22_1-1690179267927.png

 

I want to ftech the limit1, limit2, limit3 by comparing date & Site Name from table 1 with date range in table 2.

i.e. It should check the date range in which the date fits; also, if the site name matches, return the values from that row.

1 ACCEPTED SOLUTION
sanalytics
Solution Supplier
Solution Supplier

Hello @Anonymous 

 

Assuming you want to compare Table1[Date] with Table2[StartDate] and Table2[EndDate] range.

If it is then please get the below solution

Create a calculated column by writing below DAX

Limit 1 =
CALCULATE(
    MAX( Table2[Limit1] ),
    FILTER(
        Table2,
        Table1[SiteName] = Table2[SiteName] &&
        Table1[Date] >= Table2[StartDate] &&
        Table1[Date] <= Table2[EndDate]
    ) )
 
Please find the below screenshot
sanalytics_0-1690181673696.png

 

Hope it will help you.

 

Regards

sanalytics

If it is your solution then please like and accept it as solution

 

 

 

View solution in original post

3 REPLIES 3
sanalytics
Solution Supplier
Solution Supplier

Hello @Anonymous 

 

Assuming you want to compare Table1[Date] with Table2[StartDate] and Table2[EndDate] range.

If it is then please get the below solution

Create a calculated column by writing below DAX

Limit 1 =
CALCULATE(
    MAX( Table2[Limit1] ),
    FILTER(
        Table2,
        Table1[SiteName] = Table2[SiteName] &&
        Table1[Date] >= Table2[StartDate] &&
        Table1[Date] <= Table2[EndDate]
    ) )
 
Please find the below screenshot
sanalytics_0-1690181673696.png

 

Hope it will help you.

 

Regards

sanalytics

If it is your solution then please like and accept it as solution

 

 

 

Anonymous
Not applicable

Thanks @sanalytics 🙂

@Anonymous 

Glad, it worked. Would appreciate if you like the solution.

 

Regards

sanalytics

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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