Forum Discussion
wasirafi
2 years agoHelper I
DAX Error when using If Statement with DateAdd
https://1drv.ms/u/s!AjIGh95acxebg6JDCZEPNu4K7yIYQg?e=i1Vuqa - PBIX File Hi PB Community i am trying to use If statement in my DAX expression as below new date1 = IF('bi v_shift'[shiftName]...
- 2 years ago
pls try this
Column = IF( 'bi v_shift'[shiftName]= "night"&& 'bi v_shift'[startOffsetMinutes]>55, 'bi v_shift'[dateTimeNearestHour].[Date]-1, 'bi v_shift'[dateTimeNearestHour].[Date] )
Ahmedx
2 years agoSuper User
replace the following expression
DATEADD('bi v_shift'[dateTimeNearestHour],-1,DAY)
with
bi v_shift'[dateTimeNearestHour]-1
- wasirafi2 years agoHelper I
still the same error
- Ahmedx2 years agoSuper User
remove these ( )
I also advise you to give columns and tables a normal name without spaces or hyphens.- wasirafi2 years agoHelper I
Ahmed,
I only removed "()" not the content inside it, as that is the second IF criteria.
I did note your point on not having Spaces and Hypen in the name of the table. The Dataset is owned by 3rd party and i cannot influence that.
The error still remains