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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Handling Multiple dates inside visual

So I have a table with multiple dates: 'Opened Date', 'Closed Date', 'Maintenance Start Date', 'Maintenance End Date'.

Other than dates I have also 'Total Approved'.

 

I have created a calendar table and created inactive relationships to be able to handle all dates using USERELATIONSHIP.

Currently I have 2 Measures:

 

 

Total Approved by Maintenance End Date = 
CALCULATE(
    SUM ( Table[TOTAL APPROVED] ),
    USERELATIONSHIP(
        dCalendar[Date],
        Table[MAINTENANCE END DATE]
    )
)
Total Approved by Closed Date = 
CALCULATE(
    SUM ( Table[TOTAL APPROVED] ),
    USERELATIONSHIP(
        dCalendar[Date],
        Table[CLOSED DATE]
    )
)

 

 

 I can see each one separately in a column chart, but I wanted to have a consolidated view. I wanted to create a column chart which has Closed Date as X-axis, Total Approved as Values, and Maintenance End Date as Legend. Something like I did in this Excel below (but if I could group by Month, instead of Year, it'd be even better).

gcorazza_0-1619468415158.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 

 

To do what you want you have to have role-playing date/time dimensions. You can't achieve it with just one Date table. Sorry. Please create as many date tables as there are dates you want to visualize independently.

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Sorry, I cannot share it as there are many sensitive data.

Anonymous
Not applicable

@Anonymous 

 

To do what you want you have to have role-playing date/time dimensions. You can't achieve it with just one Date table. Sorry. Please create as many date tables as there are dates you want to visualize independently.

Anonymous
Not applicable

Makes sense...so I should create another date table (as I only want a visual with 2 of the dates), but then what? Should I create inactive relations between all dates again? Should I relate the date tables as well?

 

I was actually thinking about something more on the line of using Summarize to group the costs by maintenance end date, but I don't know if that would work.

Anonymous
Not applicable

Inactive relationships are created when one and the same table joins to another on 2 or more different fields. You don't have such a situation since in this case each date table will join to the same table on one (and different) field.

Anonymous
Not applicable

Thanks man, I did a little digging on role-playing dimensions and I understood what was missing. It's actually quite simple: since I had relationships with all dates, I was just a matter of using the maintenance end date as legend.

 

gcorazza_2-1620394621370.png

 

 

Anonymous
Not applicable

@Anonymous 

 

I'll give you a valuable piece of advice (one that one day may save your back if you follow it): Never use columns directly from fact tables to slice and dice data. Always use dimensions. In fact, fact tables should always be hidden from view and only measures should have direct access to their columns.

 

If you don't follow this advice, you'll have yourself to blame for incorrect figures in your measures in the future.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors