The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello community,
I am trying to create a field parameter where two measures are added with one selection. I have no idea if this is actually possible.
Something along the lines of this:
Benchmark Categories = {
("Value", NAMEOF('Facts'[Value]) & NAMEOF('Facts'[AndValue]), 0),
("Frequency", NAMEOF('Facts'[Frequency]), 1),
("Volume", NAMEOF('Facts'[Volume]), 2)
}
Is this possible somehow? Alternative ways of achieving the same would also be appreciated.
I want to add two measures to every selection in the field parameter, one actual value and one a comparison value
Dont know if this is actual anymore, but in case someone searches for it: You can do that "old fashioned". Before there were field parameters this was done by an additional table. You crate a table with your selections in it, just one column. For a Table NewTable example:
Measure |
A |
B |
Now you put Measure in a slicer. From there you can add as many dependent measures as you link. For Example:
SUM=
SWITCH(
VALUES(NewTable[Measure]), "A", SUM(ColumnX),"B",SUM(ColumnY)
)
AVG=
SWITCH(
VALUES(NewTable[Measure]), "A", AVERAGE(ColumnX),"B",AVERAGE(ColumnY)
)
You have to fill in NewTable, Measure, ColumnX and ColumnY as in your example.
I used hierarchies to organize columns and then followed instructions from this video Youtube to create parameters for hierarchy.
One of my hierarchy includes Product Category and Product Subcategory. Using technique from the video - you can group them together under one field parameter.
This video explains how to use multiple filelds for one Paremeter option:
This is great. Same fields parameters but you can group them and select on the grouping instead of the individual field parameters. I would accept this one as the solution (but not sure if it applies welll to the original thread poster). Thanks tyatsenko!
Hi, I think I have found a solution for this.
I had been trying to select two measures with one field as well (one with the actual data and another with targets), and I managed this by:
- Creating two different field parameters with the fields in the correct order (parameter 1 with real data for fields A, B and C; parameter 2 with targets for A, B and C)
- Estabilishing a relationship between the two parameters based on the hidden index field (this is why order is important)
- Adding only one of the created fields to a slicer
This way, by selecting values on a single slicer you can use both parameters on your visuals.
@Anonymous , You can always select two there.
Or you can two field parameters. what is the objective?
Hello and thank you for your reply,
How do I go about adding two there? The code I shared does not work unfortuneately.
The use case is having two seperate measures added to a visualization, one with actuals and one with a comparison measure I have defined. In the Field Parameter slicer I want to just select one of three possible values and any of the three selections will put two measures on the visual rather than having six options and the user has to select the two.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
78 | |
66 | |
52 | |
50 |
User | Count |
---|---|
121 | |
120 | |
78 | |
63 | |
62 |