Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Good Afternoon Everyone,
I have a good one here!
I have a requirement to allow users the ability to create their own Custom Variances exactly as the image below (See image 1)
1. I have created 2 Field Parameters that holds all of the measures used to populate the table and that part works as expected!
The issue I am running into is I need to create a Variance column based on what the user selects from Slicer A minus Slicer B. (refer to Image 1). I've tried different measures but I can't get it to work.
Also I think it's important to note the fields used to create these measures:
Please, If anyone has any insight - it will be greatly appreciated!
Thank You
@Greg_Deckler I see where you are going with this. With this approach, would this require me to add in all the possible selcetions that a user can select?
@Chanise89 Unfortunately yes. 😞
So I am still working through this & I just read your article on your dislike of CALCULATE.
Is there another way to write this statement w/o the use of CALCULATE:
@Chanise89 Well, this is a brute force way to do it. I can't think of anything elegant since most things I have tried around this lead to composite key errors or would require the use of EVALUATE.
Variance =
VAR __Var1 = MAX('Variance 1'[Variance 1])
VAR __Var2 = MAX('Variance 2'[Variance 2])
VAR __Result =
SWITCH(TRUE(),
__Var1 = "Measure 1" && __Var2 = "Measure 2", [Measure 1] - [Measure 2],
__Var1 = "Measure 1" && __Var2 = "Measure 3", [Measure 1] - [Measure 3],
__Var1 = "Measure 2" && __Var2 = "Measure 1", [Measure 2] - [Measure 1],
__Var1 = "Measure 2" && __Var2 = "Measure 3", [Measure 2] - [Measure 3],
__Var1 = "Measure 3" && __Var2 = "Measure 1", [Measure 3] - [Measure 1],
__Var1 = "Measure 3" && __Var2 = "Measure 2", [Measure 3] - [Measure 2]
)
RETURN
__Result
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 70 | |
| 45 | |
| 43 | |
| 36 | |
| 23 |
| User | Count |
|---|---|
| 196 | |
| 125 | |
| 105 | |
| 77 | |
| 56 |