Forum Discussion
Anonymous
7 years agoNot applicable
Need help for Dax expression
Hi, I need to implement the below logic in DAX If Direction = Inbound then COUNT DISTINCT (GS_SENDER_ID) else If Direction = Outbound then COUNT DISTINCT (GS_RECEIVER_ID) and I have written ...
PattemManohar
Community Champion
7 years agoAnonymous Please try this..
CountResult = VAR _InboundCount = CALCULATE(DISTINCTCOUNT(Test[GS_SENDER_ID]),Test[Direction]="I") VAR _OutboundCount = CALCULATE(DISTINCTCOUNT(Test[GS_RECEIVER_ID]),Test[Direction]="O") RETURN IF(Test[Direction]="I",_InboundCount,_OutboundCount)
- Anonymous7 years agoNot applicable
Hi,
I have used your expression and it gives me a error like below screen shot:
- v-jiascu-msft7 years ago
Microsoft Employee
Hi Anonymous,
Add a MIN if that formula is the solution.
if(MIN('Test'[Direction]) = "I",Best Regards,
Dale