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.
Hello,
I have a chart with three lines showing: rural, urban and total market shares. My goal is that with a slicer you can select which of the lines to show. If none are selected (or "all"), all three lines should be shown.
The market share is measure calculated by calcuating and dividing other measures. In the data the 3 areas are flagged with a value and used in the measures as a condition, like below example:
My sales | All sales | Area_code | Area_name |
10.000 | 100.000 | 0 | Rural |
40.000 | 400.000 | 1 | Urban |
50.000 | 500.000 | 2 | Total |
Example measure:
My_sales_rural =
CALCULATE (
SUM (
Table[Sum_My_Sales]),
Table[Area_code] = 0
)
In the report I'd like to be able to select in the slicer "rural" and then only see the line for rural market share, when selecting "total" only see the line for total market share.
to this:
I've tried dynamic measures, but that gives me one line instead of three when nothing or "all" is selected in the slicer. And I've tried SWITCH(), but that also did not work well.
Any ideas?
Solved! Go to Solution.
Hi @mphillenga ,
I created a exmalp pbix in the end you can refer.
With this measure and please modify it to suit your model.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @mphillenga ,
I created a exmalp pbix in the end you can refer.
With this measure and please modify it to suit your model.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks a lot!
why you have this condition in your measure Table[Area_code] = 0
it is forcing it to filter for Area Name = RURAL, if you remove this and everything should work, not sure what you are trying to achieve with this filter.
I would ❤ Kudos if my solution helped. If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡
👉
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks for your response @parry2k
This condition is in the data because we calculate three measures. One for '0', one for '1' and one for '2'.
We want to be able to switch these on and off.
If you have any solutions, please let me know
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |