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
Anonymous
Not applicable

Filter table with OR condition

Hello,

 

I have a table with 2 dates, which I display in my page:

Table.png

 

 

 

 

 

 

 

 

Below, I have 2 bar charts showing how many elements have been opened and closed in a month :

 

Opened (x-axis: opening date) :

Opened.png

 

 

 

 

 

Closed (x-axis: closing date) :

Closed.png

 

 

 

 

 

 

 

Clicking on a month in the "Closed" chart will filter my table to only display elements closed in this month.

What I want to do now and don't know how to, is filter my whole page with a date slicer (or a month dropdown list) to display elements that have been opened OR closed in this period.

 

If I filter on August, it should give me:

Table filtered.png

 

 

 

 

 

 

 

Is there a way to do that? Maybe with unactive relationships but I haven't found a solution so far...

4 REPLIES 4
v-danhe-msft
Employee
Employee

Hi @Anonymous,

Could you please offer some sample data to have a test and post your desired result if possible?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

My data and page (all my data is in the table displayed):

page.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Relationship:

relations.png

 

 

 

 

 

 

 

 

 

 

 

 

 

Date = CALENDAR(DATE(2000;1;1); DATE(2050;12;31))

Stores closed = 
CALCULATE(
    COUNT(Table1[closing date]);
    USERELATIONSHIP(Table1[closing date]; 'Date'[Date])
)

Stores opened = 
CALCULATE(
    COUNT(Table1[opening date]);
    USERELATIONSHIP(Table1[opening date]; 'Date'[Date])
)

What I want when I click on August or when I filter my page on August with a slicer: opened OR closed in August:

Filtre sur aout désiré.png

 

 

 

 

 

 

 

petrovnikitamai
Resolver V
Resolver V

try this

1. create a table with unique dates

date = CALENDAR(DATE(2018;01;01);DATE(2018;12;31))

2. create non-active relationships between date(1)->(*)opening date and date(1)->(*)closing date

image.png

3. Create two measures that calculate count opening and closing dates

open.cnt = CALCULATE(COUNT('table'[opening date]);USERELATIONSHIP('table'[opening date];'date'[Date]))

close.cnt = CALCULATE(COUNT('table'[closing date]);USERELATIONSHIP('table'[closing date];'date'[Date]))

4. get plot where axis=dates 

image.png

 

 

mb someone knows better way to get it

Anonymous
Not applicable

@petrovnikitamai

I tried this, but there are 2 problems:

- my date slicer with 'date'[date] doesn't filter my table ;

- when I click on a chart, it doesn't filter my table either.

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.