cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mitchmoore2
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
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
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
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
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors