cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
joshuap
Helper I
Helper I

Merging two graphs with date as x axis

Hi all, 

 

I'm trying to merge two graphs onto one to highlight some trends over the past year. 

 

The data i'm using is safety certificates so each one has an expiry date and an issue date. I'm trying to show on the graph, how many expired in each month of the year and how many were issued. (As seen in picture on 2 separate graphs). 

joshuap_0-1613132290100.png

However, when I go to merge these two on a graph, it will either use the expiry date or issue date as the x axis and then both will show the same valules (as seen below). 

joshuap_1-1613132380677.png

Does anyone know how I can use dates as a x-axis that aren't linked to either date? Or is there a simpler way for me to do this?

 

Thanks in advance.

1 ACCEPTED SOLUTION
yingyinr
Community Support
Community Support

Hi @joshuap ,

You can create a Date table first and set date field of Date table as X axis for your column chart. Then create two measures as below:

 

Count of rk_issuedate =
CALCULATE (
    SUM ( table[rk] ),
    FILTER (
        ALLSELECTED ( table ),
        table[issue date] <= SELECTEDVALUE ( Date[date] )
    )
)​
Count of rk_expirydate =
CALCULATE (
    SUM ( table[rk] ),
    FILTER (
        ALLSELECTED ( table ),
        table[expiry date] <= SELECTEDVALUE ( Date[date] )
    )
)

 

Best Regards

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.

View solution in original post

2 REPLIES 2
yingyinr
Community Support
Community Support

Hi @joshuap ,

You can create a Date table first and set date field of Date table as X axis for your column chart. Then create two measures as below:

 

Count of rk_issuedate =
CALCULATE (
    SUM ( table[rk] ),
    FILTER (
        ALLSELECTED ( table ),
        table[issue date] <= SELECTEDVALUE ( Date[date] )
    )
)​
Count of rk_expirydate =
CALCULATE (
    SUM ( table[rk] ),
    FILTER (
        ALLSELECTED ( table ),
        table[expiry date] <= SELECTEDVALUE ( Date[date] )
    )
)

 

Best Regards

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.

View solution in original post

amitchandak
Super User IV
Super User IV

@joshuap ,You have to create a common date table. If they are from the same table there will one inactive join which you can activate using userealtionship

 

refer examplehttps://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors