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
Anonymous
Not applicable

Filter on date from other table

My dataset contains a table with support tickets: Ticket. This table contains a date-field: CreatedDate. Each Ticket has a corresponding Project (Relationship: Ticket.ProjectId-Project.ProjectId). A project can be completed. In this case Project.CompletedDate gets filled in.

 

I have made a card visual showing the total amount of Tickets created (Using a date table). I have used a slicer for this (relative date slicer, say: last 7 days). Now, I want to create a new card displaying the total amount of completed Tickets within these 7 days (count tickets joining on ProjectId where Project.Completeddate = within 7 days). I want to use that same slicer for that.

 

I can't really figure out how to achieve this, since I am fairly new to Power Bi.

 

I hope I've made my problem clear...

Thanks in advance

3 REPLIES 3
parry2k
Super User
Super User

@Anonymous create a relationship between date table and completed date, it will be an inactive relationship because you already have a relationship on create date and inactive relationship is ok, add the following measure for completed tasks count

 

Completed Count = 
CALCUALATE ( COUNTROWS ( TicketTable ), 
USERELATIONSHIP ( TicketTable[CompletedDate], DateTable[Date] ), 
TicketTable[CompletedDate] <> BLANK()
)

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



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.

Anonymous
Not applicable

I Don't really understand how this works and my own DAX formula doesn't XD.

Thanks a lot!

 

And I was wondering: If I wanted to create a card showing me all tickets that have been created (Ticket.CreatedDate) AND completed (Project.CompletedDate) within these 7 days, how would I do that? Because then I would need to use both relationships in one formula it seems...

Hi @Anonymous ,

Could you please provide some sample data(exclude sensitive data) in table Ticket and Project? Then we can provide you the measures or sample pbix file which suitable for your scenario. 

In addition, you can refer the contents in the following links to achieve it.

POWER BI AND DAX – USERELATIONSHIP TO WORK WITH MULTIPLE DATES 

Calculate Transactions In Last N Days in Power BI Using DAX

Measure for count of last 7 days

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.