Forum Discussion
Comparing Budget Vs Actual in Matrix, getting "Cannot convert Value " of type Text to type Numeric"
- Anonymous2 years ago
Hi GarlonYau ,
Based on your description, this appears to be an issue with text types and numeric types not converting to each other. The error you're experiencing may stem from the way Power BI handles division by zero, or a situation where the denominator (in this case ) is missing or equal to zero. When using the Divide function, the third argument provides a way to handle errors or division by zero. However, specifying the empty string ("") as an alternate result can sometimes lead to unexpected behavior, especially when Power BI requires a numeric value. You can modify the following dax to thisRevenue / Day % Variance = VAR BudgetPerDay = [Revenue Budget / Day] VAR ActualPerDay = [Revenue Actual / Day] RETURN IF( ISBLANK(BudgetPerDay) || BudgetPerDay = 0, BLANK(), DIVIDE(ActualPerDay - BudgetPerDay, BudgetPerDay) )For more details on using the divide function you can check out this documentation
DIVIDE function (DAX) - DAX | Microsoft LearnBest regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
this worked beautifully, Thank you so much for your help!