I have created a dashboard in PBI using a dataflow from a live database. I am trying to replicate the constraints of a query in DAX and am a little lost on how to get the correct DAX syntax/results.
Below is the query:
SELECT count(IPID) as theSwitches
FROM KUB.MVIEW_E_SWITCH
WHERE (NORMALPOSITIONA = 0 OR NORMALPOSITIONB = 0 OR NORMALPOSITIONC = 0)
AND (FEEDERID <> FEEDERID2)
AND FEEDERID2 is not null
Here is my DAX:
TIE= (MVIEW_E_SWITCH[NORMALPOSITIONA]= 0 ||
MVIEW_E_SWITCH[NORMALPOSITIONB] = 0 ||
MVIEW_E_SWITCH[NORMALPOSITIONC]= 0)
&& (MVIEW_E_SWITCH[FEEDERID] <> MVIEW_E_SWITCH[FEEDERID2])
&& NOT(ISBLANK(MVIEW_E_SWITCH[FEEDERID2]))
Here is some dummy data:
IPID NORMALPOSITIONA NORMALPOSITIONB NORMALPOSITIONC FEEDERID FEEDERID2
123141 1 1 1 GC21 GC12
145361 0 0 1
096842 0 0 0 BC21 BC32
053912 0 0 0
018249 1 1 1
827247 0 1 0 HD32 HD32
I know it is not going to count these, but I wanted to just get a true/false column and only count the true values for my report section of the PBIX.
Is Dax the correct language to perform this, or should I look to use M Code in the Power Query Editor? Any thoughts would be greatly appreciated.
Thanks!