cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PaulW2
Frequent Visitor

Can't drop measure into chart's x-axis end point

I've created a measure:  LastScheduledSession = max('Sessions'[Date/Time Scheduled])

I want to use that measure as the endpoint for all my charts so all the charts end at the same date and are visually comparable.

[Date/Time Scheduled] is a date.  I can drop the measure into a card and it displays the date/time nicely.  Yet I can not click or drag that measure into the "End" field in the format of my charts.  I can enter "=1" which converts it to "1/1/2001 12:00:00 AM" and that works.  If I paste the measure formula in "= max('Sessions'[Date/Time Scheduled])" it has no effect but leaves the formula there AND when I select other charts it just leaves the formula there and also has no effect.   

Here's a couple images.

How can I do this?  Or solve the problem with some other solution?

Thanks.

Can't drop measure into Chart's X-Axis EndCan't drop measure into Chart's X-Axis End MeasureProblem2.PNGMeasureProblem3.PNG MeasureProblem4.PNG

 

1 ACCEPTED SOLUTION
PaulDBrown
Super User II
Super User II

@PaulW2 

Create a measure along the lines of:

Cutting off by date =
VAR CutoffDate =
    DATE ( 2020, 03, 31 ) // in your case, your max date measure
RETURN
    IF ( MAX ( 'Calendar Table'[Date] ) <= CutoffDate, 1 )

Now select the visual, and add this measure to the "Filters on this visual" in the filter pane and set the value to 1:

result.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @PaulW2,

Currently, you can't use measure expressions to dynamic control the range of the axis.
I'd like to suggest you write measure expressions to compare the current date and specific date range and return tag. You can use it on 'visual level filter' to filter records.

Applying a measure filter in Power BI 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
PaulDBrown
Super User II
Super User II

@PaulW2 

Create a measure along the lines of:

Cutting off by date =
VAR CutoffDate =
    DATE ( 2020, 03, 31 ) // in your case, your max date measure
RETURN
    IF ( MAX ( 'Calendar Table'[Date] ) <= CutoffDate, 1 )

Now select the visual, and add this measure to the "Filters on this visual" in the filter pane and set the value to 1:

result.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

PhilipTreacy
Super User III
Super User III

Hi @PaulW2 

These links may help you 

Dynamic X axis on charts - Power BI - RADACAD

Solved: Dynamic change in X Axis - Microsoft Power BI Community

Phil Seamark on DAX

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors