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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to limit date axis from today to last value of data

Hello,

 

I'm having a problem displaying my data.

What I want is to show the X axis from today to the date with last value from another table. What I have is an overflow of dates as this (red line indicating where I want X axis to stop).

BestUser1_0-1642153255908.png

Additionally, my data model looks like this

[Date]1---*[valuetable]

And my measure like this:

CALCULATE(SUM('valuetable'[Values]),'valuetable'[Date]>=TODAY(),USERELATIONSHIP('valuetable'[Date],'Date'[Date]))
 
My date table covers a period from 1.1.2000 to 1.1.2040
1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

Change Categorical to Continuous:

continuous.gif

 

 

Best Regards,
Eyelyn Qin
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

4 REPLIES 4
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

Change Categorical to Continuous:

continuous.gif

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please create a flag measure:

Measure = 
var _maxdate=MAXX(ALL('Date'),[Date])
return 
IF(MAX('valuetable'[Date])>=TODAY()&& MAX('valuetable'[Date])<=_maxdate,1,0)

And drag it to filter pane, set as "is 1":

Eyelyn9_0-1642485347546.png

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi!

 

This almost worked for me. Is there an easy alternation here so I can display blank dates as well? This measure does cut the date to last date of valuetable but it also erases empty values from X axis. 

freginier
Solution Specialist
Solution Specialist

Measure = 
SUMX( 
    SUMMARIZE(
        FILTER(
            'Table', 
            'Table'[Date]<TODAY()
        ),
        'Table'[Date],
        "@sum",SUM('Table'[Amount])
    ),
[@sum]
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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