Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I'm trying to create a stacked bar chart that has a legend to segment between "Covered" and "Not Covered". However, I need the values of each segment to be dynamic based on a filter selection, and have the ability to select each segment on the bar chart to then show the detail in a separate table (e.g If i select "Covered" for the computer and/or product segment of the bar chart, the other table will filter for only those that are "covered", and vice versa)
Note the 1 represents if it is covered by that provider, and the 0 is not covered. The original concept I designed was fairly static, so thats why the overall coverage column is there. As mentioned previously, I'm looking for that column to be dynamic based on the selections (e.g For product B, if Apple and Microsoft are selected, then "not covered", but if Apple and Google are selected, then "covered"). If atleast one of the companies is selected in the slicer and one of them has a value of 1, then it would be considered covered.
Unit | Product | Apple | Microsoft | Tesla | Overall Coverage | |
Computers | A | 1 | 0 | 1 | 1 | Covered |
Computers | B | 0 | 1 | 0 | 0 | Covered |
Computers | C | 1 | 1 | 1 | 1 | Covered |
Computers | D | 1 | 1 | 0 | 1 | Covered |
Phones | E | 1 | 0 | 0 | 0 | Covered |
Phones | F | 1 | 1 | 1 | 1 | Covered |
Phones | G | 0 | 1 | 0 | 1 | Covered |
Phones | H | 0 | 1 | 0 | 1 | Covered |
Phones | I | 0 | 0 | 0 | 0 | Not Covered |
Is there a solution be available that would allow me to select the companies (Apple, Google, Tesla, Microsoft) via slicer (one aggregated one) and based on the selections, it would return covered or not covered in a segmented bar chart fashion, but allow for the filtering to be done at the covered/not covered level in the bar chart? I'm not sure on the exact DAX logic, but I would imagine it would be something like "If Apple and Tesla are selected, and the sum of both columns is >1, then 1, else 0". I'm just not sure how to account for the filtering aspect of the bar chart that I'm looking for. Perhaps a disconnected Covered/Not Covered table that acts as a legend (although If its disconnected, im not sure the filtering by segment in the bar chart would work)?
I'd like the bar chart to look something like this, which is currently using measures as the x-axis, but it doesnt allow for filtering since the two segments are measures:
Really appreciate any help/guidence!
You shouldn't need to have two separate expressions.
Overall coverage field can be dropped into the legend and will work with one measure, which I have added in the below example as a generic count:
This will be sensitive to selections.
Is this what you were looking for?
Pi
User | Count |
---|---|
47 | |
26 | |
22 | |
17 | |
15 |
User | Count |
---|---|
55 | |
34 | |
18 | |
17 | |
15 |