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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
vjnvinod
Impactful Individual
Impactful Individual

Week Ending Date in Power query editor using custom coloumn

Hi All,

 

Currently i am using the below formula  in excel to get my week ending date 

=[@[Transaction Date]]+7-WEEKDAY([@[Transaction Date]],16)

 

How do i get this logic in power query editior using custom coloumn?

i am aware i can create a "calculated coloumn" but for some reason i want to do this calculation in power query editor?

 

Let me know if you can help on this

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

In the code for the step you added for end of week, just add Day.Saturday like this

 

= Table.AddColumn(#"Inserted Quarter", "End of Week", each Date.EndOfWeek([Date], Day.Friday), type date)

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
mahoneypat
Microsoft Employee
Microsoft Employee

In the code for the step you added for end of week, just add Day.Saturday like this

 

= Table.AddColumn(#"Inserted Quarter", "End of Week", each Date.EndOfWeek([Date], Day.Friday), type date)

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


CNENFRNL
Community Champion
Community Champion

Hi, @vjnvinod , it's even easier in Power Query; a prêt-à-manger functionality is available on UI.

Untitled.pngUntitled.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

vjnvinod
Impactful Individual
Impactful Individual

@CNENFRNL 

 

This is good, but looks like its taking saturday as week ending in my data

is there anyway we can change this to Friday as week ending 

 

basically below logic(which is in excel)

=[@[Transaction Date]]+7-WEEKDAY([@[Transaction Date]],16)

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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