datediff

dida

New Member
Joined
Jun 27, 2011
Messages
15
[FONT=&quot] I Have one table of calendar in the query simply dates. another table of projects and start date of the projects.[/FONT]
[FONT=&quot]I wish to choose the project and then get in the calendar table another columns that compare the chosen project start date to the date in the calendar/ I could not find any way to do it. date diff doesn't not work with chosen from slicer[/FONT]
[TABLE="class: mce-item-table"]
<tbody>[TR]
[TD]PROJ[/TD]
[TD]date[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]13/01/2016[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]19/01/2016[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]04/01/2016[/TD]
[/TR]
</tbody>[/TABLE]
[FONT=&quot] [/FONT]
[TABLE="class: mce-item-table"]
<tbody>[TR]
[TD]date[/TD]
[TD]date diff from project[/TD]
[/TR]
[TR]
[TD]01/01/2016[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]02/01/2016[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]03/01/2016[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]04/01/2016[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]05/01/2016[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]06/01/2016[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]07/01/2016[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]08/01/2016[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]09/01/2016[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]10/01/2016[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]11/01/2016[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]12/01/2016[/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
 
edit queries
on the left you'll see two tables, on the right Applied Steps
choose first table and see steps
edit Added Custom (little gear, and you'll see what I did)
check each step so you will see the whole way how it was done.

for datediff
select column date (as first) and date.1 (as second) then use from the ribbon: Add column - Date - Subtract Days

slicer is just a filter , nothing more :) so add slicer and select column with PROJ (A, B, C)

I cannot say too much about MDX because I don't use PowerBI often (I can say: very rare ;) )
 
Last edited:
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
I did it all. but once I add project to the source database and tried to refresh I could not:-( is that the way it works in power query?
secondly it looks that date diff looks good in the query but in the table its not...
I wish I could add attachment
I used to do all in MDX
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,575
Members
452,652
Latest member
eduedu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top