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.
I'm trying to add two stacked columns to one stacked column chart and can't figure out how to do it.
I've created four measures. Two of them--call them P1 and P2--are prices derived from a table imported from an Excel worksheet. The other two--D1 and D2--are the same prices with some discounts applied. The discounts come from a set of slicers whose values are a set of constants: 0, 5, 10, 15, and so on. The idea is to let the user set the discounts and see how the discounted D1-D2 stack compares to the original prices in the P1-P2 stack.
I can easily create a stacked column chart that uses the P1 and P2 measures as values, and another stacked column chart that uses the D1 and D2 measures as values. That gives me two charts that look like this:
Original Prices
P1
P2
Discounted Prices
D1
D2
But these two charts can have different y-axis ranges, and that makes the stacks hard to compare. What I'd like to have is one chart that contains both stacks:
Original and Discounted Prices
P1 D1
P2 D2
How can I do that? I've tried using ROW and UNION to create a table that contains the four measures, and feeding that table to one stacked column chart, but the table (and therefore the chart) don't seem to get updated when the user changes the discount slicers.
Thanks!
Hi @MrJLa,
Would you please share some sample data and screenshots about expected results for our analysis?
Best Regards,
Qiuyun Yu
I'd be happy to. Here is a simplified example.
Let's say I have a "Prices" table that contains original and discounted prices for two products:
I can easily use a stacked column chart to show the revenue that these prices would generate, like so:
This stacked column chart is exactly what I want.
The problem, however, is that the Prices table I showed above doesn't actually contain a "With Discount" row. Instead, the user dynamically selects a discount from a slicer:
...and then I use two measures to calculate the discounted prices using the selected discount:
When the user selects a new discount, the height of the "With Discount" column should change.
So now I have four values that I want to use to create the stacked column chart I showed above--two original prices that are pulled from a table, and two discounted prices that are calculated dynamically using measures.
Is there any way to do this?
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 |
---|---|
108 | |
105 | |
88 | |
74 | |
66 |
User | Count |
---|---|
124 | |
112 | |
98 | |
81 | |
72 |