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...
Arjunarao
7 years agoResolver I
Rubal
7 years agoHelper II
Hi Arjun,
Changing the formatting didn't solve the error :(
- Arjunarao7 years agoResolver IYes. But why dont you upload the sample file?
- tarunsingla7 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
- Rubal7 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 :(