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
Saxon10
Post Prodigy
Post Prodigy

Multiple slicer into one slicer in visual

 

I have 4 different filter for same id and result. I am currently I am currently using 4 different slicer to see result.

 

If it possible to build 4 different filter in one slicer (ignore the blanks value) instead using 4 different slicer.

If I select the Fillter1 then it will showing relevant(result1) results only.

I am looking for both measure and calculated option.

 

Data:

IdResultFillter1Fillter2Fillter3Fillter4
123WinOKNOOKOK
124lossOKNOOKOK
125tieOKNOOKOK
126winOKNOOKOK
127winOKNOOKOK
128winOKOKNOOK
129lossOKOKNOOK
130tieOKOKNOOK
131tieOKOKNOOK
132winOKOKNOOK
133winOKOKOKNO
134lossOKOKOKNO
135lossOKOKOKNO
136tieOKOKOKNO
137winNOOKOKNO
138lossNOOKOKOK
139tieNOOKOKOK
140winNOOKOKOK
141winNOOKOKOK
142winNOOKOKOK

 

Saxon10_0-1637312216559.png

 

 

Look like slicer

Fillters
Fillter1
Fillter2
Fillter3
Fillter4




1 ACCEPTED SOLUTION

You can't get the Status slicer to work the way you have it. You're unpivoting dimResults, which doesn't distinguish between NO and OK.

 

You need to unpivot the original table, which can be done in DAX exactly the same way you unpivoted dimResults:

UNPIVOT =
UNION (
    SELECTCOLUMNS (
        Table1,
        "Id", Table1[Result],
        "Result", Table1[Result],
        "Filter", "Filter1",
        "Status", Table1[Fillter1]
    ),
    SELECTCOLUMNS (
        Table1,
        "Id", Table1[Result],
        "Result", Table1[Result],
        "Filter", "Filter2",
        "Status", Table1[Fillter2]
    ),
    SELECTCOLUMNS (
        Table1,
        "Id", Table1[Result],
        "Result", Table1[Result],
        "Filter", "Filter3",
        "Status", Table1[Fillter3]
    ),
    SELECTCOLUMNS (
        Table1,
        "Id", Table1[Result],
        "Result", Table1[Result],
        "Filter", "Filter4",
        "Status", Table1[Fillter4]
    )
)

View solution in original post

19 REPLIES 19
MFelix
Super User
Super User

Hi @Saxon10 ,

 

Believe that what you are looking for is for the hierarchy in the slicer.

 

If you pull all your filter columns to the slicer you will get an Hierarchy and then you can filter at will:

 

MFelix_0-1637339749603.png

If you select OK on the first level then you have OK and NO.

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix,

 

Thanks for your reply and help. Similar to the hierarchy but not both of them in same slicer. (Filters and Filters status its so painful to filter the data)

All filters in one slicer (Filters 1 to 4) and all filters status in one slicer(Ok, No) and crate a measure to the table based on the both slicer.

This is I needed then I can apply the filter in both slicer then it will give a exact filter data. 

Hi @Saxon10,

 

So you want to have a slicer to select what column filter by and a other with the options of the slicer?

 

So you select filter 3 and get the options for filter 3 column and the calculations base on that selection? 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix ,

Yes, that's right.

Example If select Filter1 and selected Filter status is "Ok" then It will show only filter1 data only.

Saxon10_0-1637350552051.png

 

@MFelix ,

 

Example-  I created two tables and I don't know how to link both slicer to the table. Can you please advise...

Saxon10_1-1637351396704.png

Here is the file for your reference https://www.dropbox.com/s/ruquw1tv935kp0x/PBI%20fillter.pbix?dl=0

 

You can use these new tables in a switching measure:

 

CountID = 
VAR SelectedFilter = SELECTEDVALUE ( 'FILTERS'[FILTERS] )
VAR SelectedStatus = SELECTEDVALUE ( 'STATUS'[FILTER STATUS] )
RETURN
    SWITCH (
        SelectedFilter,
        "Fillter1", CALCULATE ( COUNT ( 'TABLE'[Id] ), 'TABLE'[Fillter1] = SelectedStatus ),
        "Fillter2", CALCULATE ( COUNT ( 'TABLE'[Id] ), 'TABLE'[Fillter2] = SelectedStatus ),
        "Fillter3", CALCULATE ( COUNT ( 'TABLE'[Id] ), 'TABLE'[Fillter3] = SelectedStatus ),
        "Fillter4", CALCULATE ( COUNT ( 'TABLE'[Id] ), 'TABLE'[Fillter4] = SelectedStatus )
    )

 

 

AlexisOlson_0-1637362230126.png

@AlexisOlson,

 

Thank you so much for your reply and help. 

Could you please able to attach the file because I got the error message so may be file will help to understand the logic. 

All I did was duplicate the bar chart and swap the implicit count of ID with the explicit measure I defined on the duplicate but here's the file.

@AlexisOlson ,

 

Thank you so much for sharing the PBI file and it's working fine. 

I would like to get the same result but other way round, status(Filters1,2,3,4) is row level(Axis) and Result is Y level and count in value.
I created calculated table (Pivot and unpivot table) in order to see multiple legends in same columns/row and I don't know how can I create a releationship from calculated table (Pivot and unpivot table) to data table. I try to use your logic but it's not working.

 

If I select all the filters and filters status is "Ok" then it will show count of filters status (Criteria range is "All filters" and filters status is "Ok" and if I select individually or multiple then it will show the count of status depends on the selections).

Can you please advise how can I achieve the results.

Saxon10_0-1637415875549.png

PBI attached here https://www.dropbox.com/s/7liaje1bq304wp2/Drill%20through%20issue.pbix?dl=0

 

Unpivoting does make life easier. You don't need fancy measures.

 

See attached.

@AlexisOlson ,

 

Thanks for your reply again. 

 

I am unable to unpivoted the data table because the Result and Filters columns not part of my original data (only id is original data). The Result and Filters columns came from 4 different tables ( I used DAX New calculate column option to bring it those values into data table).

 

Can you please advise is there anyway I can achieve the desired results without unpivot the data table.
 

I've given you both pivoted and unpivoted solutions. I don't know what more you're looking for.

@AlexisOlson ,

 

Sorry some reason the releationship not automaically detectded at my end.

I take unpivoted solution from your file and If I select the filters then visual automatically changed depends on my filter selection but the count not changed even if I selected "No" or "ok" it will give the same results only filters are changed. I understand need to change DAX formula in dimresult table but how can get the count for "ok" and "no" for same time against the result? I want to see the count result if select the "ok" or "no".

Example:

Filter 1 win is -6, Loss-4  , Tie -4 for status is "ok" and  "No"- win is -4, Loss -1, Tie-1 but the current status giving overall count 10,5,5.

Saxon10_0-1637443079817.png

 

Attached the PBI for your reference.

https://www.dropbox.com/s/xqm639a3s8a1taj/Drill%20through%20issue-AO.pbix?dl=0

 

 

You can't get the Status slicer to work the way you have it. You're unpivoting dimResults, which doesn't distinguish between NO and OK.

 

You need to unpivot the original table, which can be done in DAX exactly the same way you unpivoted dimResults:

UNPIVOT =
UNION (
    SELECTCOLUMNS (
        Table1,
        "Id", Table1[Result],
        "Result", Table1[Result],
        "Filter", "Filter1",
        "Status", Table1[Fillter1]
    ),
    SELECTCOLUMNS (
        Table1,
        "Id", Table1[Result],
        "Result", Table1[Result],
        "Filter", "Filter2",
        "Status", Table1[Fillter2]
    ),
    SELECTCOLUMNS (
        Table1,
        "Id", Table1[Result],
        "Result", Table1[Result],
        "Filter", "Filter3",
        "Status", Table1[Fillter3]
    ),
    SELECTCOLUMNS (
        Table1,
        "Id", Table1[Result],
        "Result", Table1[Result],
        "Filter", "Filter4",
        "Status", Table1[Fillter4]
    )
)

@AlexisOlson ,
Thank you so much for your help and advise. Perfect solutions.

CNENFRNL
Community Champion
Community Champion

Unpivot the dataset, if possible to apply an intergrated filter.

Screenshot 2021-11-19 105208.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Thanks for your reply and help.

 

I am unable unpivot because the filter column not part of the raw data. The filter column came from DAX so unable to unpivot. 

 

Is there any alternative way so I van achieve the results.

 

amitchandak
Super User
Super User

@Saxon10 , if you need one slicer and all 4 can filter on one value, then you can create a common table, join with 4 columns. One active join, other inactive and activate them using userelationship

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

else you need 4 slicers

 

Thanks for your reply and its looks like more complex so can you please help. 

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.