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
iamriz
Helper II
Helper II

How to dynamically show monthly cumulative record counts year on year for the past number of years?

Hi, I am trying to achieve something like the graph below. I already had the DAX function to get the cumulative counts monthly every year. But after many hours, I am still struggling to maintain the cumulative counts once I put it all out in one line graph similar to below. Also, I have data from year 2010, yet I only wanted to show cumulative data from year 2017 (or 3 years ago). How can I dynamically tell the graph to only display 3 years worth of data? I have here a sample PBIX file.  If anyone can help enlighten on this, I would really appreciate it. Thank you very much.

ques1.JPG

 

 

2 ACCEPTED SOLUTIONS
Mariusz
Community Champion
Community Champion

Hi @iamriz 

 

I've made some changes to your Model, Please see the attached 

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

View solution in original post

v-diye-msft
Community Support
Community Support

Hi @iamriz

Please let me know if you would like to get below one:

Measure = VAR currentDate = MAX('Table'[Date])

RETURN 
    CALCULATE(
        COUNTROWS('Table'),FILTER(ALL('Table'),[Date]<=currentDate),VALUES('Table 2'[Year]))

08.PNG

Pbix attached.

Community Support Team _ Dina Ye
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
iamriz
Helper II
Helper II

Hi, @Mariusz, @v-diye-msft, thanks for being awesome, your answers helped me, thank you very much!!

 

Mariusz
Community Champion
Community Champion

HI @iamriz 

 

No problem.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

v-diye-msft
Community Support
Community Support

Hi @iamriz

Please let me know if you would like to get below one:

Measure = VAR currentDate = MAX('Table'[Date])

RETURN 
    CALCULATE(
        COUNTROWS('Table'),FILTER(ALL('Table'),[Date]<=currentDate),VALUES('Table 2'[Year]))

08.PNG

Pbix attached.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Mariusz
Community Champion
Community Champion

Hi @iamriz 

 

I've made some changes to your Model, Please see the attached 

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

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.