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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
HuyNguyenn
New Member

Filter date based on other table

Hi Experts,

 I have one main table contains data. It looks like this

HuyNguyenn_0-1743652459853.png

Also I have 2nd table only contains EndOfMonth date

HuyNguyenn_1-1743652494158.png

What I want is to filter the main table only to show the End of month date from the 2nd table data.

 

Also, I want to filter end of current month, end of last moth and 31st March of the Last year.

 

How can I do that?

 

Thanks in advance

1 ACCEPTED SOLUTION

Hi @HuyNguyenn,

 

Thank you for reaching out to Microsoft Fabric Community.

 

Thank you @Deku for the prompt response.

 

To filter the Main Table based on the EndOfMonth Table follow below steps:

  • Add a Year column to the EndOfMonth table and sort the EndOfMonth table by Year (Descending) and EndOfMonth (Descending).
  • Group by Year, then add an Index Column that starts from 1 inside each year.
  • Filter the table to keep only as Index = 1 (End of the current month), Index = 2 (End of last month), for March 31 of last year, use Date.Month([EndOfMonth]) = 3 and Date.Day([EndOfMonth]) = 31
  • Merge the filtered EndOfMonth table with the Main Table like by matching TransDate to EndOfMonth.

This will filter the Main Table to show only the required end-of-month dates.

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

 

Thanks and regards,

Anjan Kumar Chippa

View solution in original post

6 REPLIES 6
Deku
Community Champion
Community Champion

If you go to your first table, go to the ribbon and select merge and perform a left semi join between the date columns. This will filter the first table to those dates from the second, without returning fields from the second table. 

 

To pre filter the second table, before the join, add a index from the ribbon. If you filter the index to 1,2 and 13 this should return this month, last month, and this month last year.


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Dear Deku,

 

Thanks for your prompt reply.

 

HuyNguyenn_0-1743661821380.png

I have added the Index, but when filter, I get 2017 and 2018 data

 

Sorry as I'm new to PBI 

Hi @HuyNguyenn,

 

Thank you for reaching out to Microsoft Fabric Community.

 

Thank you @Deku for the prompt response.

 

To filter the Main Table based on the EndOfMonth Table follow below steps:

  • Add a Year column to the EndOfMonth table and sort the EndOfMonth table by Year (Descending) and EndOfMonth (Descending).
  • Group by Year, then add an Index Column that starts from 1 inside each year.
  • Filter the table to keep only as Index = 1 (End of the current month), Index = 2 (End of last month), for March 31 of last year, use Date.Month([EndOfMonth]) = 3 and Date.Day([EndOfMonth]) = 31
  • Merge the filtered EndOfMonth table with the Main Table like by matching TransDate to EndOfMonth.

This will filter the Main Table to show only the required end-of-month dates.

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

 

Thanks and regards,

Anjan Kumar Chippa

Hi @HuyNguyenn,

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution I have provided for the issue worked? or let us know if you need any further assistance.
If my response addressed, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Thanks and regards,

Anjan Kumar Chippa

Hi @HuyNguyenn,

 

We wanted to kindly follow up to check if the solution I have provided for the issue worked.
If my response addressed, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Thanks and regards,

Anjan Kumar Chippa

Hi @HuyNguyenn,

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution I have provided for the issue worked.
If my response addressed, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Thanks and regards,

Anjan Kumar Chippa

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.