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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Ryan_K
New Member

Legend Issues when filtering using Start and End Dates

Hello,

 

I am new to using Power Bi, and I am struggling to understand an issue I am facing.

 

I have 3 tables in my model:

 

Events Table, which contains an Event Name, the specific date of the event, and the range of dates where I would like to present data for when that Event is selected, defined by Start and End Dates.

 

Screenshot 2024-03-15 101710.png

 

Date Table, which is a list of dates of the first of every month

 

Screenshot 2024-03-15 102151.png

 

Financial Data Table, which contains a list of companies, defined by "Excel ID" and certain financial data at specific dates.

 

Screenshot 2024-03-15 102106.png

 

I have created a Measure called Event Term that acts on the Date Table in order to filter based on the Start and End Dates in the Event Table. The script for this Measure is:

Event Term = 
VAR range_dates = MAX('Date Table'[Date])
RETURN
    TOCSV(
        FILTER(
            VALUES('Event Table'),
            'Event Table'[Start Date] <= range_dates && range_dates <= 'Event Table'[End Date]
        ),
        ,
        " - ",
        FALSE()
    )

 

This script allows me to create a Table Visual that appropriately shows a list of Events, the Date of the Event, the Date of the Financial Data, and the Value of the Financial Data.

 

Screenshot 2024-03-15 102656.png

 

However, when I try to visualize this data using a line chart, specifically when I add Event to the Legend, I receive an error message. Below is the line chart prior to adding Event to the Legend, and after adding Event to the Legend.

 

Screenshot 2024-03-15 102915.png Screenshot 2024-03-15 102958.png

 

It suggests I need to edit the relationships in my Data Model, but I feel I've tried everything. Is there anything I can do to get this visual to work? Below is a screen shot of my Data Model.

 

Screenshot 2024-03-15 103138.png Screenshot 2024-03-15 103622.png

 

Screenshot 2024-03-15 103715.png Screenshot 2024-03-15 103752.png

 

 

Screenshot 2024-03-15 103832.png

 

 

3 REPLIES 3
lbendlin
Super User
Super User

Ask yourself:  Can I get there from here?  for all the fields in your visual. The arrows will tell you if you can or not.  For example you cannot  (and should not) control the Financial Data table from the Events table. The arrows are pointing in the "wrong" direction.  You can control both fact tables from the calendar table.  For some reason you decided to also control the calendar from the Financial data, which means you can control the Events from the Financial Data.  This may not be what you want though.

 

If you want to use data from disconnected tables you can use measures, and/or TREATAS for filter transfer.

Thank you, this is very helpful for understanding the relationships I am making between the tables. I'm still not sure on how to solve for what I am trying to produce though. For the line graph, I am trying to get it to show two lines (one for each event) rather than just the sum of the two events. The events have overlapping date ranges, which I think is the issue at heart. It's also a bit confusing because I can show this in a table visual, but not in a line chart. Appreciate your help.

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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