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
aey
Regular Visitor

Filter visuals by 2 date columns

Hi all,

 

I need to filter measures in my Dashboard by 2 date columns. I have the columns "date of invoice sent" and "date of invoice paid". For my reporting, I need to set the filter so that "date of invoice sent" is my reporting period (e.g. 01.01.2025-30.04.2025) but at the sime time the "date of invoice paid" needs to either be blank or after 30.04.2025. I am trying to get this done through a date slicer if it is possible.

 

Is there a way to do that? I could not find any solutions while searching through the forum and internet. Would appreciate any help!!

 

Best Regards

1 ACCEPTED SOLUTION
v-ssriganesh
Community Support
Community Support

Hi @aey,
Thank you for sharing your scenario in the community forum.

I’ve reproduced your requirement in Power BI and validated the logic using sample data. The expected output is achieved successfully invoices are correctly filtered based on the selected reporting period such that:

  • Only those invoices are shown where the 'Date of Invoice Sent' falls within the selected period.
  • And the 'Date of Invoice Paid' is either blank or after the reporting period ends.

For your reference, I’ve attached a .pbix file demonstrating this logic end-to-end, including:

  • Sample MASTER and Date Period tables.
  • The DAX measure [IsValidInvoice] used for filtering.
  • A working visual that dynamically updates based on the selected reporting period.

If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.

View solution in original post

6 REPLIES 6
v-ssriganesh
Community Support
Community Support

Hi @aey,
Thank you for sharing your scenario in the community forum.

I’ve reproduced your requirement in Power BI and validated the logic using sample data. The expected output is achieved successfully invoices are correctly filtered based on the selected reporting period such that:

  • Only those invoices are shown where the 'Date of Invoice Sent' falls within the selected period.
  • And the 'Date of Invoice Paid' is either blank or after the reporting period ends.

For your reference, I’ve attached a .pbix file demonstrating this logic end-to-end, including:

  • Sample MASTER and Date Period tables.
  • The DAX measure [IsValidInvoice] used for filtering.
  • A working visual that dynamically updates based on the selected reporting period.

If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.

@v-ssriganesh Thank you very much. I only used the measure in the file you provided and modified it a little bit since I had already done the "Date Periods" structure. Now i need to set the filter to "is not 1" to work but that is fine with me. Appreciate the help!

tamerj1
Super User
Super User

Hi @aey 

place the following measure in the filter pane of the visual, select 'Is no blank' and apply tye filter

Due Payments Filter =
COUNTROWS (
FILTER (
'MASTER',
'MASTER'[date of invoice paiddd/mm/yy]
> MAX ( 'Date Periods - Date of Invoice sent'[Date of Invoice sentdd/mm/yy] )
|| 'MASTER'[date of invoice paiddd/mm/yy] = BLANK ()
)
)

aey
Regular Visitor

@tamerj1 I have tried using this method but it still displayed invoices that were paid in the reporting period. Do you happen to know why this might happen?

bhanu_gautam
Super User
Super User

@aey Create a calculated column to determine if the "date of invoice paid" is either blank or after 30.04.2025

DAX
InvoicePaidStatus =
IF(
ISBLANK('Table'[date of invoice paid]) || 'Table'[date of invoice paid] > DATE(2025, 4, 30),
1,
0
)

 

Create a measure to filter the data based on the "date of invoice sent" and the calculated column:

DAX
FilteredInvoices =
CALCULATE(
COUNTROWS('Table'),
'Table'[date of invoice sent] >= DATE(2025, 1, 1) && 'Table'[date of invoice sent] <= DATE(2025, 4, 30),
'Table'[InvoicePaidStatus] = 1
)

 

Add a slicer to your report for the "date of invoice sent" and set the date range to your desired reporting period (e.g., 01.01.2025-30.04.2025).

Use the measure in your visualizations to ensure that only the filtered data is displayed.




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

Proud to be a Super User!




LinkedIn






@bhanu_gautam thank you for the quick response!!

Is it possible to have the reporting period dynamic? Right now I use a slicer for selecting the reporting period in combination to a date slicer that lets me use a custom period for "date of invoice sent". That slicer is connected to a date table that is related to my master table. (the additional filter for "date of invoice paid" is not included in the current version)


Slicers used in dashboard:

aey_0-1745934022554.png

 

Measure in date table:

aey_1-1745934047032.png

Thanks!

 

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.