The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello Everyone,
I started new topic to not create a mess. So I had my solution working with all calculations described in this post
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:
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.
Solved! Go to Solution.
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!
Hi @Szokens,
you want to give users a single slicer where:
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.
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!
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.
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |