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
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
v-shex-msft
Community Support
Community Support

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 as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

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 as solution to help other members find it more quickly.
GilbertQ
Super User
Super User

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

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.