Forum Discussion
Rubal
Helper II
7 years agoDAX 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...
Arjunarao
Resolver I
7 years agoRubal
Helper II
7 years agoHi Arjun,
Changing the formatting didn't solve the error :(
- Arjunarao7 years ago
Resolver I
Yes. But why dont you upload the sample file?- tarunsingla7 years ago
Solution 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
- Rubal7 years ago
Helper 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 :(