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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
StillLearning1
Frequent Visitor

Cross filtering by Start & End Date

Hi,

 

I have two visuals, a table containing tasks (with Start & End dates) and a line chart showing costs. I'm trying to get it so that if I select a task, then the line chart is filtered to teh start & end date of the task. E.g. If I select Task1, then the line chart will be filtered to the costs incurred during the date range of Task1.

 

This would be even better if I could use a Gantt chart for the tasks instead of a table, but to my knowledge that is not possible.

 

So, any ideas?

 

StillLearning1_0-1681501689647.png

 

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi, @StillLearning1 

According to your description, you want to filter the line chart when you select the task in table.

This is my test data:

vyueyunzhmsft_0-1681696261858.png

(1)We can create a measure like this:

Measure = var _start_date =  MIN('Task'[Start Date])
var _end_Date = MAX('Task'[End Date])
var _cur_date =  MAX('Table'[Date])
return
IF(_cur_date>=_start_date && _cur_date <= _end_Date ,  SUM('Table'[Value]), BLANK())

(2)Then we can put this measure on the line chart and the result is as follows:

vyueyunzhmsft_1-1681696309144.png

And for how to create a Gantt chart , you can refer to this :
How to Create a Gantt Chart in Power BI (Fast and Easy) (spreadsheeto.com)

 

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

2 REPLIES 2
v-yueyunzh-msft
Community Support
Community Support

Hi, @StillLearning1 

According to your description, you want to filter the line chart when you select the task in table.

This is my test data:

vyueyunzhmsft_0-1681696261858.png

(1)We can create a measure like this:

Measure = var _start_date =  MIN('Task'[Start Date])
var _end_Date = MAX('Task'[End Date])
var _cur_date =  MAX('Table'[Date])
return
IF(_cur_date>=_start_date && _cur_date <= _end_Date ,  SUM('Table'[Value]), BLANK())

(2)Then we can put this measure on the line chart and the result is as follows:

vyueyunzhmsft_1-1681696309144.png

And for how to create a Gantt chart , you can refer to this :
How to Create a Gantt Chart in Power BI (Fast and Easy) (spreadsheeto.com)

 

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Thanks!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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