Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I've created a new field parameter based on key measure values:
The resulting selectable measures in the parameter look like this:
Measure 1,
Measure 2,
Measure 3
Here is the parameter DAX:
Measure Parameter = {
("Measure 1", NAMEOF('Key Measures'[Measure1]), 0),
("Measure 2", NAMEOF('Key Measures'[Measure2]), 1),
("Measure 3", NAMEOF('Key Measures'[Measure3]), 2)
}
Depending on which measure I select from the parameter I want a new measure to select another measure.
For example,
If "Measure 1" is selected, give me "Measure 1A",
If "Measure 2" is selected, give me "Measure 2A",
If "Measure 3" is selected, give me "Measure 1A + Measure 2A"
I've tried creating a measure with a switch statement like this:
NewMeasure = SWITCH(
SELECTEDVALUE('Measure Parameter'[Measure Parameter])
,"Measure 1", [Measure 1A]
,"Measure 2", [Measure 2A]
,"Measure 3", ([Measure 1A] + [Measure 2A])
)
But I get the following error:
Any idea where I am going wrong?
Solved! Go to Solution.
You can't use SELECTEDVALUE with the name of the parameter as that column uses the groupby functionality to ensure you have to include the fields column as well.
To determine which parameter was selected you could either use SELECTEDVALUE with the sort order column, or add a new column to the fields parameter table and use SELECTEDVALUE with that.
You can't use SELECTEDVALUE with the name of the parameter as that column uses the groupby functionality to ensure you have to include the fields column as well.
To determine which parameter was selected you could either use SELECTEDVALUE with the sort order column, or add a new column to the fields parameter table and use SELECTEDVALUE with that.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |