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
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
v-shex-msft
Community Support
Community Support

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

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

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

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

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

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...


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.