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.
Hi,
I need to create a stacked bar chart to show the increase of a value over a period of time.
E.g. in the screenshot below the light blue part is the total, and the dark blue is the increase (in absolute values) in 2019 which I obtained using a YoY quick measure.
BUT I have a problem:
the light blue shows the total up to the end of 2019, since that is the setting of the time flter which I have - and which is needed to make the YoY measure work correctly. This is wrong, since I need the light blue to display until end 2018, and the dark only the increase happend in 2019.
Is it possible to apply different time filters to the different elements of a stacked bar chart ? Or how can I get an equivalent result?
Thank you!
Solved! Go to Solution.
Hi @Anonymous
I do not believe that it is possible to apply different filter to the same measure in the graph. It would apply these filters to the measure instead.
I have created a fairly simple version. But you can of course make it more advanced by making the filter context adapt to another measure or alike.
I have created two measures:
Value after 2020 =
CALCULATE(
SUM( 'Table'[Value]);
FILTER(
'Table';
'Table'[Year] >= 2020
)
)
Value before 2020 =
CALCULATE(
SUM( 'Table'[Value]);
FILTER(
'Table';
'Table'[Year] < 2020
)
)
Which I then inserted into the graph which returns the following:
I hope this helps or at least leads you in the right direction.
Kudos is highly appriciated.
Br
Hi @Anonymous
I do not believe that it is possible to apply different filter to the same measure in the graph. It would apply these filters to the measure instead.
I have created a fairly simple version. But you can of course make it more advanced by making the filter context adapt to another measure or alike.
I have created two measures:
Value after 2020 =
CALCULATE(
SUM( 'Table'[Value]);
FILTER(
'Table';
'Table'[Year] >= 2020
)
)
Value before 2020 =
CALCULATE(
SUM( 'Table'[Value]);
FILTER(
'Table';
'Table'[Year] < 2020
)
)
Which I then inserted into the graph which returns the following:
I hope this helps or at least leads you in the right direction.
Kudos is highly appriciated.
Br
Marking this one as soluton since although it does not fix entirely my prob, can problem help most of the ppl wiht same issue.
Thanks
Hi @Anonymous
Could you then change the 'After 2020' measure to something like below:
Value after 2020 =
CALCULATE(
SUM( 'Table'[Value]);
FILTER(
'Table';
'Table'[Year] >= 2020
)
) - [Value before 2020]
Br
@Anonymous thank you,
I tried to explore this but it does not work when I build the measure with values AFTER 2019.
The reason is data sum field is progressive, so it builds up on previous values (e.g I have 2018=2, 2019=5(2+3), 2020=11(5+6), and so on.
It works with the 'BEFORE' measure, but when I do the AFTER it does not since I find myself with double counted values...
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 |
---|---|
112 | |
99 | |
73 | |
72 | |
49 |
User | Count |
---|---|
145 | |
109 | |
108 | |
90 | |
64 |