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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
Community Champion
Community Champion

@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
Community Champion
Community Champion

@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.






PhilipTreacy
Super User
Super User

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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