Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I'm trying to create a measure that adds "+2" to a sum (PRODUCTS[SALES]). But I only want to add the +2 to the values selected, e.g. I select product "Product 1" in the slicer, I add +2, but for all the other products the sales value remain the same. I have created a measure:
Solved! Go to Solution.
HI @hermanjb,
I'd like to suggest you create a variable to store the calculation result and write an if statement to check the variable that not equal to blank, then you can add '+2' on the match condition records.
Sales plus =
VAR result =
CALCULATE (
SUM ( Products[Sales] ),
ALLSELECTED ( Products ),
VALUES ( Products[ProductNames] )
)
RETURN
IF ( result <> BLANK () , result + 2 )
Regards,
Xiaoxin Sheng
HI @hermanjb,
I'd like to suggest you create a variable to store the calculation result and write an if statement to check the variable that not equal to blank, then you can add '+2' on the match condition records.
Sales plus =
VAR result =
CALCULATE (
SUM ( Products[Sales] ),
ALLSELECTED ( Products ),
VALUES ( Products[ProductNames] )
)
RETURN
IF ( result <> BLANK () , result + 2 )
Regards,
Xiaoxin Sheng
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
91 | |
89 | |
79 | |
69 | |
68 |
User | Count |
---|---|
222 | |
128 | |
117 | |
82 | |
77 |