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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.