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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
yerdaman
Advocate I
Advocate I

Custom Date Table trimming using desktop Power Que

Hi all

 

I have created a custom date table that has been uploaded to the Dataflow service that reflects our Company Accounting Periods. The table runs from 2009 to 2029 to ensue it covers most date-range requirements from the many Power BI apps that will source this date table.

 

My objective is to locally trim this large Dataflow table based on the transational requirements of the 'calling' Power BI. 

 

i.e. Start and end dates to reflect the transactional requirements of the particular model to aid date intelligence comparisons etc.

 

Desktop Power Query filters allow me to specify a hard-coded date yo delete unwanted rows but ideally I want to dynamically trim the start/end dates on each refresh based on the min/max date of another (transactional) table.

 

Any feedback would be really appreciated.

 

Thanks

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@yerdaman  group your transaction table to get min and max date, covert it to list and then filter your date table from start and end date from the list (min and max), it should be pretty straight forward. let me know if you need further help.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@yerdaman  group your transaction table to get min and max date, covert it to list and then filter your date table from start and end date from the list (min and max), it should be pretty straight forward. let me know if you need further help.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi P2k

Thanks for your suggestion.

 

I know how to establish the MIN/MAX dates from the Transactional Data but not sure how to how to configure PQ to pickup these dates. As both the custom date table and the txns table are being sourced from Dataflow, my understanding is that this is refreshed in parallell .

 

I've viewed the advanced filtering in the date column but only managed to get this working by hard-coding the 'end date' (see below)

hard-coding highlightedhard-coding highlighted

Any advice most welcome.

 

Thanks

 

 

 

 

 

@yerdaman hi i put together quick solution for your reference, in attached I created a calendar and transaction table and calendar is filterd on min and max date from transaction. take a look at steps of calendar on how it is filtered.

 

hope it is helpful, you can make changes as per your need.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Fantasic - thank you for your swift solution P2K - much appreciated.

 

WIll now implement your logic into the model.

 

Cheers

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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