Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi Guys,
I have two columns where both are without "null" values:
PV_orig = ([orig_tot_fabric_assgn_qty]*[prod_cost])/4.84)and
(([g1_metres]+[g0_metres]+[g2_metres]+[dk_metres]+[allow_metres]+[qc_metres])*[prod_cost])/4.84)
Based on two above columne I want to pick higher value using below:
PV LE = if [PV_real] >= [PV_orig]
then [PV_real]
else [PV_orig]
Final result is error during Power Bi refreshing like in header. I don't understand why even there is no null value to compare and if I pick PV LE column like PV_real or PV_orig seperately then everything is works. I gues, if function is givong a problem but I don't know why.
Thanks for help.
Hi there,
Perhaps you could wrap your DAX with another if statement to protect against nulls like this:
PV_LE = if (if [PV_real] = null then 0 else [PV_real])
>= (if [PV_orig] = null then 0 else [PV_orig])
then [PV_real]
else [PV_orig]
You could also find the max pretty neatly in Power Query using this M Code as a new Column:
PV_LE = List.Max({ [PV_real], [PV_orig] }) - Returns the maximum item in the list or the optional default value if the list is empty
Let me know if this helps!
Numa
Hi @MKPartner just to be 100% sure: Did you check e.g. via "View > Column profile" or "View > Column Quality" in Power Query Editor that there definitely aren't any null-values in any of the columns used in a mulitplication for your added columns?
Don't forget to switch to "Column profiling based on entire data set" if your table has >1000 rows:
@MKPartner
Iโm fairly certain there are nulls. As @KarinSzilagyi suggested, please check Column quality and Column profile. By default, Power Query infers data types from only the first 1,000 rows. If possible, load the data into an Excel table and review the entire dataset.
Regards,
Rais