cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ToddMate Regular Visitor
Regular Visitor

Lookup - Filtering. (DAX?)

Hi All,

 

I need some help with a measure that will allow me to filter based on values in other columns.

 

I want to find the "Date" for every combination of "Account Number" & "Service ID" where the Event is "Connect"

 

There will only ever be one date for the combination of Account Number, Service ID & Event (Where the event is Connect)

 

Could anyone help with the DAX for this. Table Name Below is: ServicesFACT

 

Dax.JPG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Lookup - Filtering. (DAX?)

@ToddMate you can add following in your expression ALL(TableName)





Did I answer your question? Mark my post as a solution!


Proud to be a Datanaut! Connect with me on Linkedin.
Feel free to email me with any of your BI needs.




 




3 REPLIES 3
Super User
Super User

Re: Lookup - Filtering. (DAX?)

@ToddMate add following measure, 

 

My Date = 
CALCULATE ( MAX( ServiceFact[Date] ), ServiceFact[Event] = "Connect" ) 

drop account number, service id and my date (new measure) in a table visual and you will have the result





Did I answer your question? Mark my post as a solution!


Proud to be a Datanaut! Connect with me on Linkedin.
Feel free to email me with any of your BI needs.




 




ToddMate Regular Visitor
Regular Visitor

Re: Lookup - Filtering. (DAX?)

Hi @parry2k ,

 

Thank you very much for your solution, it worked perfectly and i will mark this as a solution accordingly.

 

However can i go one step further, the measures i am using (Again thanking you) are:

 

  • Connect Date -    ConnectDate = CALCULATE(MAX(ServicesFACT[Date]),ServicesFACT[Event] = "Connect")
  • Disconnect Date -    DisconnectDate = CALCULATE(MAX(ServicesFACT[Date]),ServicesFACT[Event] = "Churn")
  • Tenure -    Tenure = DATEDIFF(MIN([ChurnDate],[ConnectDate]),MAX([ChurnDate],[ConnectDate]),DAY)

 

This returns exactly what i am after for the account / serviceID combination.

 

But how would you determine the average Tenure across the entire database rather than Account / ServiceID specific. I thought maybe there was a way to do an average of the tenure measure which i could then slice by product etc.

 

This Power Bi is fanastic, but as a former Excel user its changing the mindset of having a flat table and averaging the tunure column values accordingly.

Super User
Super User

Re: Lookup - Filtering. (DAX?)

@ToddMate you can add following in your expression ALL(TableName)





Did I answer your question? Mark my post as a solution!


Proud to be a Datanaut! Connect with me on Linkedin.
Feel free to email me with any of your BI needs.