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
etiennemichelet
Frequent Visitor

Make a current month chart run until the end of the month

Hi,

 

I'm looking to make a line chart for the current month with cumulative values of : Revenue, Revenue last year, and Forecast. I have managed to do it but all the lines end where the data ends, which currently is the 15/12/19. Is there a way to have the data continue until the end of month?

This is what I have:

 

2019-12-16_15h21_33.png

 

This is what I want to have:2019-12-16_15h22_13.png

 

Is there a way to do this please?

 

Thanks

4 REPLIES 4
etiennemichelet
Frequent Visitor

Thanks,

 

Both of those options worked but the data still ended when the data ended.

 

I instead created a table for the whole current month and filled the data cumulatively in there.

 

Thanks for your help!

HI @etiennemichelet,

If these records do not exist in your table, formula calculation will stop at the last records and not expand records. I'd like to suggest adding a calendar with full date values(use calendar date as axis), then you can calculate through original tables based on current calendar date.

Understanding DAX Auto-Exist 

Cumulative Total 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

HI @etiennemichelet,

You can also try to use the following measure formula if it meets for your requirement:

 

Monthly Rolling=
VAR currDate =
    MAX ( table[Date] )
RETURN
    CALCULATE (
        SUM ( table[Amount] ),
        FILTER (
            ALLSELECTED ( Table ),
            YEAR ( Table[Date] ) = YEAR ( currDate )
                && MONTH ( Table[Date] ) = MONTH ( currDate )
                && Table[Date] <= currDate
        )
    )

 

If above not help, can you please share some dummy data with a similar data structure for test? 

How to Get Your Question Answered Quickly 

Regards,
Xiaoxin Sheng

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

Try

Cummalative ytd = TOTALYTD(sum(Sales[Sales Amount]),filter(all(Sales[Sales Date]),Sales[Sales Date]<=maxx('Date',('Date'[Date Filer]))),"12/31")

Cummalative lytd = TOTALYTD(sum(Sales[Sales Amount]),filter(all(Sales[Sales Date]),Sales[Sales Date]<=maxx('Date',DATEADD('Date'[Date Filer],-1,YEAR))),"12/31")

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

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.