Reply
avatar user
Anonymous
Not applicable
Partially syndicated - Outbound

Line chart range function

I currently have a report that pulls together many line items and orgainzes them by department, report date and hours. When transitioning to a new month I would like a function or measure that would search for the most recent date then calculate the first and last day of the month. 

 

Example: Most recent date is 8/3/2022 function sets minimum range to 8/1/2022 seperate function for maximum range would set the range to 8/31/2022. 

 

The reason for this is I would like a seamless transition between months so I do not have to manually change the ranges for every chart in every report.

 

Thanks in advance!

2 ACCEPTED SOLUTIONS
v-cgao-msft
Community Support
Community Support

Syndicated - Outbound

Hi @Anonymous ,

 

Try adding a Relative date filter to the line chart.

vcgaomsft_0-1659936680554.png

It will automatically filter the data for this month based on Today() automatically.

 

Or you want to display all the data, use the auxiliary line to mark the current month's data:

Please new measures:

start of the month = EOMONTH(TODAY(),-1) + 1
end of the month = EOMONTH(TODAY(),0)

Add Lines:

vcgaomsft_1-1659937322350.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

Syndicated - Outbound

Hi @Anonymous ,

 

Do you want something like this?

vcgaomsft_1-1660095974546.png

If yes, please try measures like:

line_1 = 
CALCULATE (
    [Measure],
    FILTER (
        ALLSELECTED ( 'Calendar' ),
        'Calendar'[Date]
            = EOMONTH ( MAX ( 'Calendar'[Date] ), -1 ) + 1
    )
)
line_2 = 
CALCULATE (
    [Measure],
    FILTER (
        ALLSELECTED ( 'Calendar' ),
        'Calendar'[Date]
            = EOMONTH ( MAX ( 'Calendar'[Date] ), 0 )
    )
)

The PBIX file is attached for reference.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

3 REPLIES 3
avatar user
Anonymous
Not applicable

Syndicated - Outbound

Gao,

This answer gets me close because it will filter the data for the current month. However this does not help me update the range of the line chart. Could this be done through a measure?

Syndicated - Outbound

Hi @Anonymous ,

 

Do you want something like this?

vcgaomsft_1-1660095974546.png

If yes, please try measures like:

line_1 = 
CALCULATE (
    [Measure],
    FILTER (
        ALLSELECTED ( 'Calendar' ),
        'Calendar'[Date]
            = EOMONTH ( MAX ( 'Calendar'[Date] ), -1 ) + 1
    )
)
line_2 = 
CALCULATE (
    [Measure],
    FILTER (
        ALLSELECTED ( 'Calendar' ),
        'Calendar'[Date]
            = EOMONTH ( MAX ( 'Calendar'[Date] ), 0 )
    )
)

The PBIX file is attached for reference.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

v-cgao-msft
Community Support
Community Support

Syndicated - Outbound

Hi @Anonymous ,

 

Try adding a Relative date filter to the line chart.

vcgaomsft_0-1659936680554.png

It will automatically filter the data for this month based on Today() automatically.

 

Or you want to display all the data, use the auxiliary line to mark the current month's data:

Please new measures:

start of the month = EOMONTH(TODAY(),-1) + 1
end of the month = EOMONTH(TODAY(),0)

Add Lines:

vcgaomsft_1-1659937322350.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

avatar user

Helpful resources

Announcements
March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)