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
bullius
Helper V
Helper V

Running total of distinct values by year

Hello,

 

I have data that shows which of our organisation's groups attended which events for the past two years. I am trying to create a chart that shows a running total of distinct groups for each year, by month. It would look something like this:

 

Event Attendance EG.jpg

 

 

The data looks something like this:

 

GroupIDEventDate
1A01/02/2016
1B01/06/2016
1C01/10/2016
2A01/02/2016
2B01/06/2016
3A01/02/2016
4B01/06/2016
4C01/10/2016
5B01/06/2016
1A01/02/2017
1B01/06/2017
2B01/06/2017
3B01/06/2017
3C01/10/2017
4B01/06/2017
5B01/06/2017
6B01/06/2017
7C01/10/2017

 

I am able to create a running total for the whole period, but not one that resets at the beginning of each year.

 

Any help welcome.

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Create a Calculated Column "Year" and then Create a Measure 

 

Running Total =
CALCULATE (
    DISTINCTCOUNT ( Table1[GroupID] ),
    FILTER (
        ALL ( Table1 ),
        YEAR ( Table1[Date] ) = MAX ( Table1[Year] )
            && Table1[Date].[Date] <= MAX ( Table1[Date].[Date] )
    )
)

 

This will reset the Running Total for every Year you have. 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Create a Calculated Column "Year" and then Create a Measure 

 

Running Total =
CALCULATE (
    DISTINCTCOUNT ( Table1[GroupID] ),
    FILTER (
        ALL ( Table1 ),
        YEAR ( Table1[Date] ) = MAX ( Table1[Year] )
            && Table1[Date].[Date] <= MAX ( Table1[Date].[Date] )
    )
)

 

This will reset the Running Total for every Year you have. 

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.