Forum Discussion
wasirafi
Helper I
2 years agoDAX 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
Super User
2 years agoremove these ( )
I also advise you to give columns and tables a normal name without spaces or hyphens.
wasirafi
Helper I
2 years agoAhmed,
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
- Ahmedx2 years ago
Super User
Is this columns in this table or in another?
- wasirafi2 years ago
Helper I
All the columns are from the same Table.
- wasirafi2 years ago
Helper I
i just attached the PBIX file....if that helps
- Ahmedx2 years ago
Super User
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] )