Forum Discussion
Anonymous
6 years agoNot applicable
Help with GROUP BY and measures (translate from SQL code)
Hello guys, I need to do something like this SQL code inside POWER BI: Basically I'm converting "facturacion" to negative when certain conditions are met. SELECT
anunciante,
SUM(
CAS...
v-eachen-msft
Community Support
6 years agoHi Anonymous ,
I used ISINSCOPE() function based on your orginal measures. You could refer to the following DAX:
Measure =
VAR a =
SUMX ( ALLSELECTED ( 'Table'[ANUNCIANTE] ), [Fact. Acumulado] )
RETURN
IF ( ISINSCOPE ( 'Table'[ANUNCIANTE] ), [Fact. Acumulado], a )
Measure 2 =
VAR a =
SUMX ( ALLSELECTED ( 'Table'[ANUNCIANTE] ), [Fact. año completo] )
RETURN
IF ( ISINSCOPE ( 'Table'[ANUNCIANTE] ), [Fact. año completo], a )
Here is the results.