Forum Discussion
Anonymous
3 years agoNot applicable
Dynamic names in field parameters (Selectedvalue)
Hi community, I am trying to get dynamic column names in my tables in a way that it always shows the Gross revenue for the selected year and the year before. I am using a field parameter and I ...
noverkamp
3 years agoFrequent Visitor
| Year | Line | EUR |
| 2022 | A | 10 |
| 2022 | B | 20 |
| 2022 | C | 25 |
| 2023 | A | 14 |
| 2023 | D | 69 |
| 2023 | F | 50 |
Fact table:
Dimension Table:
OT_Year =
DISTINCT(
SELECTCOLUMNS(
CALENDAR(
DATE(2022, 1, 1),
TODAY()
),
"Year", FORMAT(year([Date]), "0")
))
Visual:
Dynamic_parameter_field_EUR:
Dynamic_parameter_field_EUR =
VAR selected_year = SELECTEDVALUE(OT_Year[Year])
Return
{
("Year ("&selected_year&")", NAMEOF('Fact'[Measure_EUR]), 0)
}
Anonymous
3 years agoNot applicable
Hi,
I had something similar but look it shows year () and not year (2022) for example. It looks like selected year gets ignored and that was my issue too.
SELECTEDVALUE('Calendar (Posting Date)'[Year])-1 resulted in ' -1'
Kind regards,
Remco
- noverkamp3 years agoFrequent Visitor
Hi Remco, that's correct.
It shows Year () and not Year (2022)- Anonymous3 years agoNot applicable
That's unfortunately my issue, I would love the year to be shown, but as far as I am aware that is not possible to this date.
- lbendlin3 years agoSuper User
- is the OT_Year table joined or disconnected? If it is joined then you don't need the dynamic field parameter.
- if you expect the user to always select exactly one year then make the slicer single select.