Forum Discussion
Rubal
7 years agoHelper II
DAX IF Formula error
Hi, I am getting the below errors on the If Formula. Can anyone please help on how to resolve it? Thank you. Vol(Cases / Suom) = if (t_sales_aggregate[Actual or Forecast]="Forecast", (t...
tarunsingla
7 years agoSolution Sage
Try this:
Vol(Cases / Suom) =
IF (
t_sales_aggregate[Actual or Forecast] = "Forecast",
( t_sales_aggregate[Volume (Cases)] && t_sales_aggregate[Volume (SUOM)] )
* AVERAGE ( t_sales_aggregate[Forecast Growth] ),
FORMAT(( t_sales_aggregate[Volume (Cases)] && t_sales_aggregate[Volume (SUOM)] ), "General Number")
)
This will ensure that the data type of the result if true is the same as data type of the result if false i.e. Decimal Number in your case.
Give it a try.
Regards,
Tarun
Rubal
7 years agoHelper II
Hi Tarun,
I have tried your piece of code and still showing me the same error. I just don't know what is going on with this :(