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

Close Gap Between Measures on Stacked Area Chart

I have 10 measures in a Stacked Area chart, in two sets of 5. One set is anything less than and equal to today and the other set is anything forcasted or greater than today. My issue is that the two measures create a gap in the visual between today and tomorrow. Is there a way to close this gap? If I make both measures where today is in the data then they stack up and it looks worse...

 

taylorb_0-1597423239183.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

hi  @taylorb 

Just adjust the Forecasted measure as below:

Forecasted = IF(MAX('Date'[Date])= TODAY(),[Historical],
CALCULATE(
    DISTINCTCOUNT(AssignmentsRef[ID]), 
    Filter(HistoricalTOAAssignmentsRef, 
    ([STATUS] = "Cleared to Start"  || ([STATUS] = "Cancelled" && AssignmentsRef[WAS_NEVER_STARTED] = false)) &&
    AssignmentsRef[TYPE] = "Long Term" &&
    AssignmentsRef[ActiveDate] > TODAY() &&
    AssignmentsRef[ActiveDate] <= TODAY()+14 &&
    AssignmentsRef[LOB] = "Manufacturing"
    ))
)

 

'Date'[Date] is the field which is in X-axis of Stacked Area Chart. if the date field in in X-axis of Stacked Area Chart is AssignmentsRef[ActiveDate], you just use it instead of 'Date'[Date].

 

Regards,

Lin

Community Support Team _ Lin
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

9 REPLIES 9
Community Champion
Community Champion

Hi @taylorb 

 

Do you have time component in the date column? that might be causing it otherwise I can't think of a way it can be done.

 

Did I resolve your issue? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!!

 

Regards,
Pranit

 

 

 

 


Hope it resolves your issue? Please consider accepting it as the solution to help the other members find it more quickly.


Appreciate your Kudos, Press the thumbs up button!!👍


Regards,
Pranit


Super User II
Super User II

Hi @taylorb ,

 

Seeing the screenshot that you shared, it shows that one of your measure calculations has value till August 14 and the other one has value from August 15 to the last value on the x-axis.

 

Click on your visual, under format options on visualisation pane, go to x-axis option, there is a padding option. Check that if that helps.

 

Thanks,

Pragati





If this helps, Appreciate a KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




It doesnt look like there is a padding option for this visual

Hi @taylorb ,

 

Apologies for this. There is a Category Width option which you can check as highlighted below:

Pragati11_0-1597425365947.png

 

Thanks,

Pragati





If this helps, Appreciate a KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




There is not a time component, only date.

Memorable Member
Memorable Member

Hi @taylorb ,

 

You need to decrease the inner padding from format:

Format -> X-Axis -> Decrease Inner Padding %

 

Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!

Super User I
Super User I

 

Can you post some sample data and your DAX forumlas?  My first thought is to alter the "Past Values DAX" to somehow also include +1 Day in the future Data.  So if you were looking at Past data for 8/10-14, change the code so it 'fakes' a 15th date = 8/15 from your future data?  (Or Duplicates 8/14 data for 8/15 in the Past if you can't pull from the future data?)

 

FOrrest

 

 



Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


Proud to be a Super User helping give back to the community!
Thank You!




DAX Examples:

 

Forecasted = 
CALCULATE(
    DISTINCTCOUNT(AssignmentsRef[ID]), 
    Filter(HistoricalTOAAssignmentsRef, 
    ([STATUS] = "Cleared to Start"  || ([STATUS] = "Cancelled" && AssignmentsRef[WAS_NEVER_STARTED] = false)) &&
    AssignmentsRef[TYPE] = "Long Term" &&
    AssignmentsRef[ActiveDate] > TODAY() &&
    AssignmentsRef[ActiveDate] <= TODAY()+14 &&
    AssignmentsRef[LOB] = "Manufacturing"
    ))
Historical = 
CALCULATE(
    DISTINCTCOUNT(AssignmentsRef[ID]), 
    Filter(HistoricalTOAAssignmentsRef, 
    ([STATUS] = "Cleared to Start"  || ([STATUS] = "Cancelled" && AssignmentsRef[WAS_NEVER_STARTED] = false)) &&
    AssignmentsRef[TYPE] = "Long Term" &&
    AssignmentsRef[ActiveDate] <= TODAY() &&
    AssignmentsRef[LOB] = "Manufacturing"
    ))

 

They are literally the same data, just want the line to change to dotted after Today(), if I make both sets where they have Today() in their data then it stacks all the lines together on one day and looks way worse than the gap. See this example where I had one of the forecasted measures be >= Today() instead of just >

powerbi.png

hi  @taylorb 

Just adjust the Forecasted measure as below:

Forecasted = IF(MAX('Date'[Date])= TODAY(),[Historical],
CALCULATE(
    DISTINCTCOUNT(AssignmentsRef[ID]), 
    Filter(HistoricalTOAAssignmentsRef, 
    ([STATUS] = "Cleared to Start"  || ([STATUS] = "Cancelled" && AssignmentsRef[WAS_NEVER_STARTED] = false)) &&
    AssignmentsRef[TYPE] = "Long Term" &&
    AssignmentsRef[ActiveDate] > TODAY() &&
    AssignmentsRef[ActiveDate] <= TODAY()+14 &&
    AssignmentsRef[LOB] = "Manufacturing"
    ))
)

 

'Date'[Date] is the field which is in X-axis of Stacked Area Chart. if the date field in in X-axis of Stacked Area Chart is AssignmentsRef[ActiveDate], you just use it instead of 'Date'[Date].

 

Regards,

Lin

Community Support Team _ Lin
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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors