This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I have a card visualization that shows the value based on the year selection. I have a slicer of the year (values are last 5 years- 2017, 2018, 2019, 2020, 2021). The slicer is having multiple selection options. I want to show the value of each year when a single selection of years is done, but when multiple years are selected, I want to see the value of the latest year (2021) (no sum or avg or count or first or last). Please help.
Solved! Go to Solution.
You will need a measure, something along these lines.
Display Amount =
VAR _Years =
COUNTROWS ( DISTINCT ( Table[Year] ) )
RETURN
SWITCH (
TRUE (),
_Years = 1, [Value Measure],
_Years > 1, CALCULATE ( [Value Measure], Table[Year] = 2021 )
)
Thanks a lot.. Its working now.
You need a measure to sum the value.
Value Meausure = SUM ( XYZ[Value] )
Then the measure to read the selection and display the correct version of the sum.
Display Measure =
VAR _Years =
COUNTROWS ( DISTINCT ( XYZ[Year] ) )
RETURN
SWITCH (
TRUE (),
_Years = 1, [Value Meausure],
_Years > 1, CALCULATE ( [Value Meausure], XYZ[Year] = 2021 )
)
I have attached my sample file for you to look at.
You will need a measure, something along these lines.
Display Amount =
VAR _Years =
COUNTROWS ( DISTINCT ( Table[Year] ) )
RETURN
SWITCH (
TRUE (),
_Years = 1, [Value Measure],
_Years > 1, CALCULATE ( [Value Measure], Table[Year] = 2021 )
)
I am still getting the error. This is my table (Table name XYZ).
This is my year selection slicer.
I created a new measure as below.
I am not getting the output. It would be great if you can provide detailed steps after creating the measure.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 32 | |
| 26 | |
| 23 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 65 | |
| 41 | |
| 28 | |
| 22 | |
| 22 |