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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Charlespbi
Regular Visitor

How to handle two date conditions on the same chart while keeping visual interaction in Pow

Hello,

 

I have been trying for several days now to solve an issue in my Power BI report.

 

Context:
I am analyzing ticket creation, resolution date, and compliance for a client.

 

How:
I determine whether tickets fall within the scope of the analysis by applying several filters:

  • ticket type
  • resolution date
  • a date range
  • status

Why:
Once the tickets meet these criteria, my measure returns "OK" if they are compliant, or "KO" if they are not.

 

Requirements:
First, I need to check that tickets are in "Authorized" status and that their [duedate] is earlier than the date selected in the filter.

Second, I need to check that tickets are in status ("Qualified" OR "Closed") and that [duedate] falls within a date range selected in the filter.

Additional constraints:

  • Both KO and OK tickets must be displayed on the same chart.
  • There must be only one single [duedate] date filter on the report page.
  • The chart must remain interactive with the table showing the ticket details within the analysis scope. In other words, when I click on the "KO" slice in the chart, only KO tickets should appear in the table. Same for OK tickets.

 

Here is the formula with the date filters included, just to illustrate the logic:

C1 = 
IF(
    AND(
        OR(
            NOT(AND(
                'TABLE'[statusName] = "Authorized",
                'TABLE'[duedate]<=DATE(2025,12,15)
            )),
            'TABLE'[statusName] IN {"Technically qualified", "Operationally qualified", "Closed"} &&
            NOT(ISBLANK('TABLE'[TQ_StatusDate])) &&
            'TABLE'[duedate] >= DATE(2025,09,01) &&
            'TABLE'[duedate] <= DATE(2025,12,15)
            ),
            'TABLE'[TQ_StatusDate]<='TABLE'[duedate]
    ),
    "OK",
    "KO"
)

 

Problem:
If I filter on the interval from 2025-09-01 to 2025-12-15, the first part of my formula is no longer exhaustive, because for that part I need to include everything before 2025-12-15, not just what falls inside the selected interval.

I managed to work around this by using the ALL() function (to remove the date constraint) in order to count tickets matching the criteria and display them in a single chart, but this only gives me aggregated counts and removes the interaction with the detail table.

 

Thank you in advance for your help.

 

Charles

1 ACCEPTED SOLUTION
techies
Super User
Super User

Hi @Charlespbi have applied the conditions, please review if this solves the issue.

 

 

 

Power BI & Microsoft Fabric
PL-300 | DP-600 | DP-700 Certified

View solution in original post

7 REPLIES 7
Charlespbi
Regular Visitor

Hello, I cannot share a .pbix file, I don't have the "super user" rights.
https://drive.google.com/drive/folders/14ogpfMw5kY8su1PahFjJchJnRjz4lOSB?usp=drive_link
I can only share a Gdrive link.

techies
Super User
Super User

Hi @Charlespbi have applied the conditions, please review if this solves the issue.

 

 

 

Power BI & Microsoft Fabric
PL-300 | DP-600 | DP-700 Certified

Hello @techies, that solves the problem ; thank you very much.
Unfortunately, another issue has come up.

Let’s say I want to filter tickets by resolver group. Since there is no relationship between the ‘ComplianceCategories’ table and the ‘Tickets’ table, the filters don’t apply to the chart.

Should I follow the same logic as for the ‘SlicerDate’ table and create a ‘Contract’ table?

yes, and also Replace ALL with ALLSELECTED in Count OK and Count KO so any slicer on the Tickets table works

 

 

Power BI & Microsoft Fabric
PL-300 | DP-600 | DP-700 Certified

It works @techies, thank you so much.

Hello @techies, I'll take a look at it and let you know. 
Thank you 

 

Gabry
Super User
Super User

Hey,

i think you need to use a separate date table. Could you attach a pbix file? It will be easier.

 

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.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.