Forum Discussion
Anonymous
6 years agoNot applicable
Change SQL to DAX
Hi. I have these 2 SQL clauses I need to use in PowerBI measure. This one I need to add decimals = Rivisumma alv 0% = SUMX ( 'ol', [price] * ( [quantity] ) / (1 + [alv] /100)) This is how I do ...
- 6 years ago
Anonymous , Try like
round(SUMX ( 'ol',divide( [price] * ( [quantity] )*1.0 ,(1 + [alv] /100.0))),2)
Change data type to decimal. You can Avoid round by giving it column/measure tools
SUMX('ol' , Switch(True(), ol[price] > 0 , ol[quantity] , ol[price] < 0 , -1* ol[quantity] , 0 ))
amitchandak
6 years agoSuper User
Anonymous , Try like
round(SUMX ( 'ol',divide( [price] * ( [quantity] )*1.0 ,(1 + [alv] /100.0))),2)
Change data type to decimal. You can Avoid round by giving it column/measure tools
SUMX('ol' , Switch(True(), ol[price] > 0 , ol[quantity] , ol[price] < 0 , -1* ol[quantity] , 0 ))