Hi
I'm trying to create a TotalHours measure in my Model that is connected to OCLG table in SAP Business One. In this table that store the activities exist the DurType Field which values are 'H', 'M' or 'D'.
In my SQL sentences, I use this: select sum (case when DurType='M' then Duration/60 else Duration end) from OCLG
And Now I want to translate this to DAX. But when I write this
TotalHoras = SWITCH(Horas[DurType],'M',Horas[Duration]/60,'H',Horas[Duration])
I have error: Cannot find table 'M'
But If I use IF I have error too
TotalHoras = IF([DurType]='M',[Duration]/60,[Duration])
Any idea, please?
regards