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...
Rubal
7 years agoHelper II
Hi Arjun,
Please excuse my ignorance. but where is the difference between the codes? seems exactly the same as mine but formatting. appreciate your help.
Arjunarao
7 years agoResolver I
- Rubal7 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