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
nitinsu
Regular Visitor

Slicer filtering

HI,

 

I have data as in the below example

 

Col1Col2Col3
AllData11
XYZData12
ABCData13
AllData24
AllData25

 

I have a slicer that maps to Col1 above and a graph control that shows the values of col3 on a line chart (have not shown the datetime in the above sample).

 

As in the data above, for Col2=Data1 the Col1 values are 'All' along with other values, whereas for Col2=Data2 the Col1 values is always 'All'. I wanted to default show the Col1='All' values on the graph even when the user selects any other values from the Col1 slicer in the UI i.e. if "ABC" is selected then the Data1 should be filtered for Col1="ABC" but Data2 should be filtered for "All".

 

Is this possible, any help on how this can be achieved?

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @nitinsu 

Create a new table

Table new = Table1

Add [Col1] from "Table new" in the slicer.

 

Create meausres in Table1

SELECTED_Col1 = SELECTEDVALUE('Table new'[Col1])

SELECTED_Col2 = SELECTEDVALUE('Table new'[Col2])

flag =
IF (
    [SELECTED_Col1] = "ALL",
    IF ( [SELECTED_Col1] = MAX ( Table1[Col1] ), 1, 0 ),
    IF (
        MAX ( Table1[Col2] ) = "DATA2",
        1,
        IF ( [SELECTED_Col1] = MAX ( Table1[Col1] ), 1 )
    )
)

value = SUM(Table1[Col3])

Add [flag] in the viusal level filter as below

9.png

Best Regards
Maggie

 

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

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @nitinsu 

Create a new table

Table new = Table1

Add [Col1] from "Table new" in the slicer.

 

Create meausres in Table1

SELECTED_Col1 = SELECTEDVALUE('Table new'[Col1])

SELECTED_Col2 = SELECTEDVALUE('Table new'[Col2])

flag =
IF (
    [SELECTED_Col1] = "ALL",
    IF ( [SELECTED_Col1] = MAX ( Table1[Col1] ), 1, 0 ),
    IF (
        MAX ( Table1[Col2] ) = "DATA2",
        1,
        IF ( [SELECTED_Col1] = MAX ( Table1[Col1] ), 1 )
    )
)

value = SUM(Table1[Col3])

Add [flag] in the viusal level filter as below

9.png

Best Regards
Maggie

 

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

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.