Forum Discussion
MoM% Showing the Infinity Value
- 2 years ago
Hi ADSL ,
This typically occurs when you divide a number by zero. In this case, the problem arises when the [PMTD-Sales] measure returns a value of 0, which is then used as the denominator in your MoM-Sales calculation.
Try something like this:MoM-Sales = VAR CurrentMonthSales = [MTD-Sales] VAR PreviousMonthSales = [PMTD-Sales] RETURN IF( PreviousMonthSales = 0, BLANK(), (CurrentMonthSales - PreviousMonthSales) / PreviousMonthSales )For reference on error handling in DAX formulas: DAX error reference
Pedro Reis - Data Platform MVP / MCT
Making Power BI and Fabric Simple
If my response resolved your issue, please mark it as a solution to help others find it. If you found it helpful, please consider giving it a kudos. Your feedback is highly appreciated!
Find me at LinkedIn
Hi ADSL ,
This typically occurs when you divide a number by zero. In this case, the problem arises when the [PMTD-Sales] measure returns a value of 0, which is then used as the denominator in your MoM-Sales calculation.
Try something like this:
MoM-Sales =
VAR CurrentMonthSales = [MTD-Sales]
VAR PreviousMonthSales = [PMTD-Sales]
RETURN
IF(
PreviousMonthSales = 0,
BLANK(),
(CurrentMonthSales - PreviousMonthSales) / PreviousMonthSales
)
For reference on error handling in DAX formulas: DAX error reference
Pedro Reis - Data Platform MVP / MCT
Making Power BI and Fabric Simple
If my response resolved your issue, please mark it as a solution to help others find it. If you found it helpful, please consider giving it a kudos. Your feedback is highly appreciated!
Find me at LinkedIn
- ADSL2 years agoPost Prodigy
Hi pmreis ,
May I need your help and advise of Card visual? That's still showing as the screenshot below, it should be zero -- 0.00 or 0%.
Thanks and Regard,
- pmreis2 years agoMost Valuable Professional
Hi ADSL
You have everything right on this file you shared! It's just that the period you selected (January) doesn't have a previous month, hence the calculation for the previous month doesn't work, neither the variations as you don't have a previous month value.
Try another month and you will see it works just fine.
Pedro Reis - Data Platform MVP / MCT
Making Power BI and Fabric Simple
If my response resolved your issue, please mark it as a solution to help others find it. If you found it helpful, please consider giving it a kudos. Your feedback is highly appreciated!
Find me at LinkedIn- ADSL2 years agoPost Prodigy
Thank you for your helpful feedback and support.