cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Is there anyway I can make a date slicer cut across multiple fields at the same time?

Trying to create a slicer that can dynamically cut accross multiple date fields in the same table at the same time. Is this possible? I heard others mention the userealionship function but I'm not sure that will work in this case. Not having more than one relationship active makes it seem nearly impossible. Here are what my realtionships look like. All link back to the date primary key. Any help would be appreciated. Thanks.

BI.PNG

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Is there anyway I can make a date slicer cut across multiple fields at the same time?

Hi @mitchmoore2,

 

Current power bi only support one active relationship each table. For your requirement, I'd like to suggest you to add a measure to check the multiples fields and use the measure to filter visual.

 

Sample:

Measure formula.

Check Tag(OR) =
VAR selected =
    IF ( HASONEVALUE ( 'CALENDAR'[Date] ), VALUES ( 'CALENDAR'[Date] ), BLANK () )
RETURN
    IF (
        MAX ( 'Test Tabel'[Date1] ) = selected
            || MAX ( 'Test Tabel'[Date2] ) = selected
            || MAX ( 'Test Tabel'[Date3] ) = selected
            || MAX ( 'Test Tabel'[Date4] ) = selected
            || MAX ( 'Test Tabel'[Date5] ) = selected
            || MAX ( 'Test Tabel'[Date6] ) = selected
            || MAX ( 'Test Tabel'[Date7] ) = selected,
        "Y",
        "N"
    )

Check Tag(AND) =
VAR selected =
    IF ( HASONEVALUE ( 'CALENDAR'[Date] ), VALUES ( 'CALENDAR'[Date] ), BLANK () )
RETURN
    IF (
        MAX ( 'Test Tabel'[Date1] ) = selected
            && MAX ( 'Test Tabel'[Date2] ) = selected
            && MAX ( 'Test Tabel'[Date3] ) = selected
            && MAX ( 'Test Tabel'[Date4] ) = selected
            && MAX ( 'Test Tabel'[Date5] ) = selected
            && MAX ( 'Test Tabel'[Date6] ) = selected
            && MAX ( 'Test Tabel'[Date7] ) = selected,
        "Y",
        "N"
    )

Create table visual.

3.PNG

 

Result:

2.PNG

 

Notice: Check Tag(OR) show 'Y' when one of the date fields equal to selected calendar date; Check Tag(AND) show 'Y' when all date fields are equal to selected calendar date.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Super User IV
Super User IV

Re: Is there anyway I can make a date slicer cut across multiple fields at the same time?

Hi @mitchmoore2


The only other solution that I could think of off hand is to have a seperate Date table per Date column in your EmployeeFact table?

 

You could do this by creating a Calculated Table (which means that it is an exact replica but only stored in Memory)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Highlighted
Community Support
Community Support

Re: Is there anyway I can make a date slicer cut across multiple fields at the same time?

Hi @mitchmoore2,

 

Current power bi only support one active relationship each table. For your requirement, I'd like to suggest you to add a measure to check the multiples fields and use the measure to filter visual.

 

Sample:

Measure formula.

Check Tag(OR) =
VAR selected =
    IF ( HASONEVALUE ( 'CALENDAR'[Date] ), VALUES ( 'CALENDAR'[Date] ), BLANK () )
RETURN
    IF (
        MAX ( 'Test Tabel'[Date1] ) = selected
            || MAX ( 'Test Tabel'[Date2] ) = selected
            || MAX ( 'Test Tabel'[Date3] ) = selected
            || MAX ( 'Test Tabel'[Date4] ) = selected
            || MAX ( 'Test Tabel'[Date5] ) = selected
            || MAX ( 'Test Tabel'[Date6] ) = selected
            || MAX ( 'Test Tabel'[Date7] ) = selected,
        "Y",
        "N"
    )

Check Tag(AND) =
VAR selected =
    IF ( HASONEVALUE ( 'CALENDAR'[Date] ), VALUES ( 'CALENDAR'[Date] ), BLANK () )
RETURN
    IF (
        MAX ( 'Test Tabel'[Date1] ) = selected
            && MAX ( 'Test Tabel'[Date2] ) = selected
            && MAX ( 'Test Tabel'[Date3] ) = selected
            && MAX ( 'Test Tabel'[Date4] ) = selected
            && MAX ( 'Test Tabel'[Date5] ) = selected
            && MAX ( 'Test Tabel'[Date6] ) = selected
            && MAX ( 'Test Tabel'[Date7] ) = selected,
        "Y",
        "N"
    )

Create table visual.

3.PNG

 

Result:

2.PNG

 

Notice: Check Tag(OR) show 'Y' when one of the date fields equal to selected calendar date; Check Tag(AND) show 'Y' when all date fields are equal to selected calendar date.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
June 2020 Community Highlights

June 2020 Community Highlights

Featured community members, changes to the Community, and more! Read up on recent Power BI community news.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors