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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
annejeel
New Member

Difference between two dates without using DAX

Hello oracle. 

 

I am VERY new to Power BI and DAX is terrifying to me, so, please be gentle 🙂 

 

I want to work out the amount of time (in days) between two dates. I'd like to work this out for the single dates but also looks at averages across all of the dates. Is this possible?, and is it possible to do without using DAX as I'm completely clueless there? 

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi  @annejeel ,

Pls test the below:(difference)

= Table.AddColumn(#"Changed Type", "Custom", each let 
s = [date1],
e =[date2],
x =
List.Generate(
()=>s,
each _<=e,
each Date.AddDays(_,1)
),
l = List.Select(
x,
each Date.DayOfWeek(_,Day.Monday)<5
)
in 
List.Count(l))

vluwangmsft_0-1653385723908.png

Average:

= Table.AddColumn(#"Changed Type1", "Custom2", each List.Average(#"Changed Type1"[datediff]))

vluwangmsft_1-1653385764999.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi  @annejeel ,

Pls test the below:(difference)

= Table.AddColumn(#"Changed Type", "Custom", each let 
s = [date1],
e =[date2],
x =
List.Generate(
()=>s,
each _<=e,
each Date.AddDays(_,1)
),
l = List.Select(
x,
each Date.DayOfWeek(_,Day.Monday)<5
)
in 
List.Count(l))

vluwangmsft_0-1653385723908.png

Average:

= Table.AddColumn(#"Changed Type1", "Custom2", each List.Average(#"Changed Type1"[datediff]))

vluwangmsft_1-1653385764999.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

Hariharan_R
Solution Sage
Solution Sage

Hi

 if you want to find the difference between two dates then you can achieve it in Power Query editor like below. Share some sample data and also show the expected result to help more. 

 

Hariharan_R_0-1652975598751.png

Hariharan_R_1-1652975693104.png

Thanks

Hari

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon & SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.