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

Combine the values from different columns into one slicer - then filter the table based on selection

Hello Everyone

I would like to combine  Sign1 and Sign2 in one slicer, then based on selection from the slicer I would like to find the max date.

Sample table-

Rid123_0-1633553024993.png



Result Expected-

Rid123_2-1633553285618.png

 

Thanks in advance

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

You'll need to create a new table for the slicer. You can do this in the query editor or in DAX like this:

SignSlicer = DATATABLE ( "Sign", STRING, { { "P" }, { "Q" } } )

 

Once you have that, you can define the Max Date measure.

Max Date =
SWITCH (
    SELECTEDVALUE ( SignSlicer[Sign] ),
    "P", CALCULATE ( MAX ( Table1[Dates] ), Table1[Sign1] = "P" ),
    "Q", CALCULATE ( MAX ( Table1[Dates] ), Table1[Sign2] = "Q" ),
    MAX ( Table1[Dates] )
)

 

View solution in original post

1 REPLY 1
AlexisOlson
Super User
Super User

You'll need to create a new table for the slicer. You can do this in the query editor or in DAX like this:

SignSlicer = DATATABLE ( "Sign", STRING, { { "P" }, { "Q" } } )

 

Once you have that, you can define the Max Date measure.

Max Date =
SWITCH (
    SELECTEDVALUE ( SignSlicer[Sign] ),
    "P", CALCULATE ( MAX ( Table1[Dates] ), Table1[Sign1] = "P" ),
    "Q", CALCULATE ( MAX ( Table1[Dates] ), Table1[Sign2] = "Q" ),
    MAX ( Table1[Dates] )
)

 

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.

Top Solution Authors