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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Szokens
Helper I
Helper I

Measure Slicer doesn't work on my visuals

Hello Everyone,

I started new topic to not create a mess. So I had my solution working with all calculations described in this post

https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-table-column-values-chang...

Now I would like to enhance my report by additional feature available for user. I would like user to apply additional slicer which will "Include" or "Exclude" weekends in visual results. 

I have created following disconnected table:

Weekend_Toggle_Table =
DATATABLE(
    "Toggle_Weekends",
    STRING,
    "Order",INTEGER,
{
    {"Exclude",1},
    {"Include",2}
})
in my semantic model I have also connected "dmn_date" table with field "dmn_date[is_weekday]" having "Y" or "N" values.
Then I created this measure:
toogle_weekends_filter =
VAR SelectedToggle = SELECTEDVALUE(Weekend_Toggle_Table[Toggle_Weekends])
VAR Isweekday = IF(MAX(dmn_date[is_weekday])="Y",1,0)
RETURN
SWITCH(TRUE(),
    SelectedToggle="Exclude" && Isweekday=1,1,
    SelectedToggle="Include",1,
    0)
When I apply above measure to visual filters pane of randomly created table visual (screenshot below) and set value to "1", it works fine, however when I do the same for my visual with calcs described in post mentioned above, visual doesn't react.
Szokens_0-1753103448416.png

 

I don't wan't to give user ability to slice by dmn_date[is_weekday] as "Y"/"N" or all, this is why I need to invent "Include" / "Exclude" weekends slicer.

1 ACCEPTED SOLUTION
Syk
Super User
Super User

I believe you're overthinking the toggle. All you need to do is make a new conditional column based on your is_weekday. If Y then include if N then exclude. Toss that in a slicer and you're done!

View solution in original post

9 REPLIES 9
v-sgandrathi
Community Support
Community Support

Hi @Szokens,

 

you want to give users a single slicer where:

  • Include → Shows all days (Mon-Sun)
  • Exclude → Shows only weekdays (Mon-Fri)

You don’t want to expose the is_weekday column directly to users, which makes sense.

The issue is happening your measure works fine when you test it in a simple table that shows dates and weekdays.
But when you apply the same logic in visuals where you have pre-calculated logic or summary calculations like in your previous post, the dmn_date[is_weekday] context may not be properly available.
That’s why the toggle is not reacting properly in those visuals.

Please find the attached file for your reference.
Hope this helps if you have any queries we are  happy to assist you further.


Regards,
Sahasra.

is it possible to make it working as expected in Barchart or Linechart? I see in the simple table it is ok but when trying to apply on mentioned visuals I don't get how to customize them to make it working.

Hi @Szokens,

 

Yes, it is certainly possible to have your weekend toggle slicer function within visuals such as bar charts and line charts. However, it is important to ensure that the filtering logic is incorporated directly into the DAX measures used in these visuals.

While your current method is effective in table visuals due to the row context, bar and line charts rely on aggregated data and may not respond to visual-level filters in the same way. Therefore, embedding the logic within the measure calculation is essential for consistent results.

 

Total_Value_With_Toggle :=

VAR SelectedToggle = SELECTEDVALUE(Weekend_Toggle_Table[Toggle_Weekends], "Include")

RETURN

CALCULATE(

    [Your_Base_Measure], -- Replace with your actual base measure (e.g., [Total Sales])

    FILTER(

        dmn_date,

        SWITCH(

            TRUE(),

            SelectedToggle = "Exclude" && dmn_date[is_weekday] = "Y", TRUE(),

            SelectedToggle = "Include", TRUE(),

            FALSE()

        )))

Use this measure in your bar or line chart.

Thank you.

Hi @Szokens,

 

I wanted to check in your situation regarding the issue. Have you resolved it?  Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!

Hi @Szokens,

 

Just wanted to follow up and confirm that everything has been going well on this. Please let me know if there’s anything from our end.
Please feel free to reach out Microsoft fabric community forum.

Hi @Szokens,

 

Just wanted to check regarding your question. We haven’t heard back and want to ensure you're not stuck. If you need anything else or have updates to share, we’re here to help!

 

Thank you.

Syk
Super User
Super User

I believe you're overthinking the toggle. All you need to do is make a new conditional column based on your is_weekday. If Y then include if N then exclude. Toss that in a slicer and you're done!

finally I have used @Syk  approach which is simpliest and fast. 

so this will give me two slicer options Mon-Fri (for "Include") and only weekends (for "Exclude"). I would need to make slicer multiselect and enable "all". Then sure it is fine.

I wonder however if is it possible to make it the way "Include" - whole week Mon-Sun, "Exclude" - without weekends, Mon-Fri and have only single selection slicer.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.