Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Aleria88
New Member

Slicer Manipulation

I have been search for 2 days on how to get this to work and none of the videos I have watched pertain to my need. I don't know if my ask is too complicated but here goes. I have two slicers. One has Production Line options and the other has Shift Options. Some production lines have two shifts and the others have one shift. I want the Shift Slicer to only show 1st Shift when certain Production Lines are selected and 1st Shift and 2nd Shift for when the others are selected. 

 

These Slicers come from two tables that don't have a relationship. So, this is the formula I used in the measure...

ShowShift =
VAR SelectedLine =
    SELECTEDVALUE ( ProductionLines[ProductionLine] )
RETURN
    IF (
        SelectedLine = "Fleetline"
            && TREATAS ( { "1st Shift", "2nd Shift" }, Shifts[Shift] ),
        1,
        IF (
            SelectedLine = "Truckline"
                && TREATAS ( { "1st Shift", "2nd Shift" }, Shifts[Shift] ),
            1,
            IF (
                SelectedLine = "HCL"
                    && TREATAS ( { "1st Shift" }, Shifts[Shift] ),
                1,
                IF (
                    SelectedLine = "Minute Miser"
                        && TREATAS ( { "1st Shift" }, Shifts[Shift] ),
                    1,
                    IF (
                        SelectedLine = "Stock Chaser"
                            && TREATAS ( { "1st Shift" }, Shifts[Shift] ),
                        1,
                        IF (
                            SelectedLine = "Titan"
                                && TREATAS ( { "1st Shift" }, Shifts[Shift] ),
                            1,
                            0
                        )))))))
 
If someone can help me I would greatly appreciate it. If not, they'll have to deal with an extra option. At this point, I don't care anymore.
3 REPLIES 3
Anonymous
Not applicable

Hi All,
Firstly AnkitKukreja thank you for your solution!
And @Aleria88 ,What I'm thinking is that if you want to dynamically affect the shift filter by using the proudction line filter, I think it's possible to do so.I think this is possible, I have tried to create some sample data myself, hopefully this will help you understand my thinking, and hopefully my approach will solve your problem.

ShowShift = 
VAR SelectedLine = SELECTEDVALUE(_Production_Lines[ProductionLine])
RETURN 
    IF (
        SelectedLine IN {"Fleetline", "Truckline"},
        IF (VALUES('Shifts'[Shift]) IN {"1st Shift", "2nd Shift"}, 1, 0),
        IF (VALUES('Shifts'[Shift]) = "1st Shift", 1, 0)
    )

After writing the MEASUREMENT, we put the MEASUREMENT into the FILTER in the shift silicer to exclude the value of 0, and we are ready to fulfill your needs.

vxingshenmsft_0-1726800116971.png

vxingshenmsft_1-1726800223953.png

I hope my thoughts help you solve your problem, if you have further questions, feel free to contact me and I will get back to you as soon as I receive the message!

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

I'll give it a try and let you know. Hopefully, it will work.

AnkitKukreja
Super User
Super User

Hi! @Aleria88 

 

Can you share the sample data from the tables, and share the expected outcome. Please make sure to hide your PII data before sharing. A sample of 10-20 rows should suffice.

 

 

 

 

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.