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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Comparing two date columns to get range of dates

Hi guys,

I am learning DAX  so need a help with below query.

 

I want to compare two date columns from two different tables,where after comparing it will display the dates like

"If values is less tan Current date it should display all those dates" and filter the data accordingly.

  In model all tables are connected using "Date" column and One to many relationship

 

Any help/Suggestion would be appreciated.

4 REPLIES 4
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

I'm not very clear about what result you want to get. 

 

If it is convenient, could you show some data sample and your desired output so that I can understand your scenairo better.

 

In addition, you could have a reference of this similar thread.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I have below tables which are connected using Date column(One to many relationship)

I want to compare Due date column from Gross table with CurrentDate column from GeneralDate table.

As in where  [Due Date] >= Current date 

Output: It should display all due date values which are  greater  than Due date 

 

General Date table.PNGGross table.PNG

Hi @Anonymous,


If it is convenient, could you share your data sample as table so that I can copy the data and make a test.

 

In addition, your desired output want to show all due date values which are greater than Due date ?

 

I'm still a little confused about your expected output, please share your the output so that I can understand your logic better.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-piga-msft

 

Consider a table: Sales Order which has a Date (say) Shipment Date. I need to compare this column with Date table.

 

For example: Date table consists a date 2/2/2018. So i should have a condition where Shipment Date < 2/2/2018. I will fetch the sum of quantities of every Shipment Date that will satisfy this condition

.

For example: The sum is 36 for 2/2/2018. So, the graph will contain 2/2/2018 on x-axis and 36 on y-axis.

 

This will be considered for every Date in the Date table.

So As per conditions applied it will display associated values with date.

 

Date_output.PNG

 

 

 

 

 

 

 

Thanks and regards,

DAX_Learner

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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