Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a Parameter table which has 3 measures of having 3 different revisions of forecasts coming from 3 different tables.
These 3 measures contain 3 different revisions of forecasts ($)
I created a slicer using this Parameter Table
Then I tried to create a measure (Forecast $) which will show the Forecast value $ depending upon which Forecast measure (revision) is picked. (measure below)
Somehow the measure above is not working and giving error
Can someone please help here
Thank you so much !!
Solved! Go to Solution.
Hi @Saurabh129
The syntax of SELECTEDVALUE & SWITCH is not quite right, and also SELECTEDVALUE cannot be used with the first column of a Field Parameter table (see this article).
Here is one way you could rewrite it:
Forecast $ =
VAR FieldParameterSelection =
IF (
COUNTROWS ( 'Forecasts' ) = 1,
VALUES ( 'Forecasts'[Forecasts] )
)
RETURN
SWITCH (
FieldParameterSelection,
"Forecast 23 BP $", [Forecast 23 BP $],
"Forecast 1Q23RF $", [Forecast 1Q23RF $],
"Forecast 2Q23RF $", [Forecast 2Q23RF $]
-- BLANK() will be returned in the case of no match
)
I'm assuming you're creating this measure so that you can write DAX expressions that reference it elsewhere, or do something that doesn't work with the normal behaviour of field parameters.
Regards
Thank you so much for your help
It worked
Hi @Saurabh129
The syntax of SELECTEDVALUE & SWITCH is not quite right, and also SELECTEDVALUE cannot be used with the first column of a Field Parameter table (see this article).
Here is one way you could rewrite it:
Forecast $ =
VAR FieldParameterSelection =
IF (
COUNTROWS ( 'Forecasts' ) = 1,
VALUES ( 'Forecasts'[Forecasts] )
)
RETURN
SWITCH (
FieldParameterSelection,
"Forecast 23 BP $", [Forecast 23 BP $],
"Forecast 1Q23RF $", [Forecast 1Q23RF $],
"Forecast 2Q23RF $", [Forecast 2Q23RF $]
-- BLANK() will be returned in the case of no match
)
I'm assuming you're creating this measure so that you can write DAX expressions that reference it elsewhere, or do something that doesn't work with the normal behaviour of field parameters.
Regards
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |