cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
anmsharma
Helper II
Helper II

Checking the Data in a definite interval and adding the value in Column

Hi Team,

 

I have a requirement that a particular 'Date' needs to be checked if it lies between 'FromDate' and 'ToDate'.

 

If yes, then I need to have separate column as 'NewDate' which will have the value of 'Date' in true condition else ' ' in false.

 

'FromDate' and 'ToDate' is in table 1 and 'NewDate' need to be added in table 1 only

'Date' is in table 2

 

Many Thanks in advance,

Anmol

1 ACCEPTED SOLUTION
v-yuezhe-msft
Microsoft
Microsoft

@anmsharma,

Create relationship as other post, then create the column using the Dax below.

NewDate = IF(RELATED(Table2[Date])<=Table1[Todate]&&RELATED(Table2[Date])>=Table1[FromDate],RELATED(Table2[Date]),BLANK())

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuezhe-msft
Microsoft
Microsoft

@anmsharma,

Create relationship as other post, then create the column using the Dax below.

NewDate = IF(RELATED(Table2[Date])<=Table1[Todate]&&RELATED(Table2[Date])>=Table1[FromDate],RELATED(Table2[Date]),BLANK())

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Salvador
Responsive Resident
Responsive Resident

Hi,

 

I'd say you first would need to establish a relationship between both tables (if you dont have it already), and then create a column with an or/if, in table 1, something like
        = or(if(table1[date]<table2[datex];table1[date];"");if(table1[date]>table2[datey];table1[date];""))

 

Regards, 

Salva.

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!