Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ToddMate
Helper II
Helper II

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

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



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
parry2k
Super User
Super User

@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



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.

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



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors