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 below sample data with 4 Columns.
Country | Account | Year | Value |
AUS | EBITDA | 2022 | 13 |
AUS | EBITDA | 2023 | 10 |
AUS | EBITDA | 2018 | 98 |
AUS | EBITDA | 2021 | 120 |
AUS | EBITDA | 2020 | 700 |
AUS | EBITDA | 2019 | 10 |
AUS | Sales | 2020 | 13 |
AUS | Sales | 2021 | 10 |
AUS | Sales | 2023 | 39 |
AUS | Sales | 2019 | 120 |
AUS | Sales | 2018 | 145 |
AUS | Sales | 2022 | 28 |
AUS | ITDA | 2023 | 10 |
AUS | ITDA | 2022 | 231 |
AUS | ITDA | 2021 | 39 |
When User selects 2020 from Slicer, Clustered Chart should display below Columns only :-
Chart shall be displayed as per below:-
Can you please advise on how to get the above result?
Solved! Go to Solution.
Hi @Sekhar1 ,
Here I suggest you to try this code to create a measure.
Measure =
VAR _SELECTYEAR = SELECTEDVALUE('Table 2'[Year])
VAR _VALUE =
IF(
ISFILTERED('Table 2'[Year]),
SWITCH(
MAX('Table'[Account]),
"EBITDA",
CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year]>=_SELECTYEAR-2&&'Table'[Year]<=_SELECTYEAR)),
"Sales",
CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year]=_SELECTYEAR)),
"ITDA",
CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year]>_SELECTYEAR&&'Table'[Year]<=_SELECTYEAR+2))
)
)
RETURN
_VALUE
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Sekhar1 ,
Here I suggest you to try this code to create a measure.
Measure =
VAR _SELECTYEAR = SELECTEDVALUE('Table 2'[Year])
VAR _VALUE =
IF(
ISFILTERED('Table 2'[Year]),
SWITCH(
MAX('Table'[Account]),
"EBITDA",
CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year]>=_SELECTYEAR-2&&'Table'[Year]<=_SELECTYEAR)),
"Sales",
CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year]=_SELECTYEAR)),
"ITDA",
CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year]>_SELECTYEAR&&'Table'[Year]<=_SELECTYEAR+2))
)
)
RETURN
_VALUE
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
115 | |
99 | |
88 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |