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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Running total issue

Hi all,

 

Please issue sample of my data set, My data is large data below i am showing sample

Client NameCase created datecase notype
a22/08/2019222x
a22/08/2019223x
a21/08/2019224x
b20/07/2019225y
b19/07/2019226y
b15/07/2019227y
b14/07/2019228z
c13/05/2019223z
c16/05/2019229z
c17/04/2019230z
c13/03/2019231x
c12/2/2019232x

 

I want to calcualte distinct count of client code based on cases id we received last 90 days by running total.  (last three months if we received cases from the client which means client is alive)

 

I want to represents the data like below to create visual

Total Alive clients  
 JulyAug 
X1615( cases received in last three months)
Y1714 
Z1812 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please try to use following measure formula if it suitable for your requirement:

Measure =
VAR curr =
    MAX ( 'Table'[Case created date] )
RETURN
    CALCULATE (
        COUNTA ( 'Table'[case no] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            [Case created date]
                >= DATE ( YEAR ( curr ), MONTH ( curr ) - 3, 1 )
                && [Case created date] <= curr
        ),
        VALUES ( 'Table'[Client Name] )
    )

Regards,
Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

Please try to use following measure formula if it suitable for your requirement:

Measure =
VAR curr =
    MAX ( 'Table'[Case created date] )
RETURN
    CALCULATE (
        COUNTA ( 'Table'[case no] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            [Case created date]
                >= DATE ( YEAR ( curr ), MONTH ( curr ) - 3, 1 )
                && [Case created date] <= curr
        ),
        VALUES ( 'Table'[Client Name] )
    )

Regards,
Xiaoxin Sheng

Greg_Deckler
Community Champion
Community Champion

Have you tried using the built-in Running Total Quick Measure? Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors