March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi! I'm trying to show a table with past year and current year sales and the variation. For some brands where there is no data, the measure I created shows -100%. I would like to only see brands data, hiding the others.
This is the measure formula:
Var C9L vs LY = SUMX(Variables,Variables[Volume C9 Act (CY)])/SUMX(Variables,Variables[Volume C9 Act (LY)])-1
This is the result for blank data
How can I solve this?
Thanks!!!
Diego
Solved! Go to Solution.
You'll need to us IF logic to return a blank when there is a blank. By subtracting 1, you're giving it a value.
IF (SUMX( Variables,Variables[Volume C9 Act (CY)] ) <> 0, SUMX(Variables,Variables[Volume C9 Act (CY)])/SUMX(Variables,Variables[Volume C9 Act (LY)])-1, BLANK())
I would also use DIVIDE instead of the tranditional A/B
Hope this helps
David
Hi! Thanks for your help! I improved the formula and now it's working perfectly. This is how it ended:
Var C9L vs LY = IF(DIVIDE(SUMX(Variables,Variables[Volume C9 Act (CY)]),SUMX(Variables,Variables[Volume C9 Act (LY)])) <> BLANK(),(DIVIDE(SUMX(Variables,Variables[Volume C9 Act (CY)]),SUMX(Variables,Variables[Volume C9 Act (LY)]))-1),BLANK())
Thanks again!
Diego
Rather than comparing to 0 using <> 0, you could also try using the ISBLANK() function to check if the value is blank. That way, if for some reason your SUM was 0, you would actually show 0, but if it doesn't exist you would show blank.
You'll need to us IF logic to return a blank when there is a blank. By subtracting 1, you're giving it a value.
IF (SUMX( Variables,Variables[Volume C9 Act (CY)] ) <> 0, SUMX(Variables,Variables[Volume C9 Act (CY)])/SUMX(Variables,Variables[Volume C9 Act (LY)])-1, BLANK())
I would also use DIVIDE instead of the tranditional A/B
Hope this helps
David
Hi! Thanks for your help! I improved the formula and now it's working perfectly. This is how it ended:
Var C9L vs LY = IF(DIVIDE(SUMX(Variables,Variables[Volume C9 Act (CY)]),SUMX(Variables,Variables[Volume C9 Act (LY)])) <> BLANK(),(DIVIDE(SUMX(Variables,Variables[Volume C9 Act (CY)]),SUMX(Variables,Variables[Volume C9 Act (LY)]))-1),BLANK())
Thanks again!
Diego
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |