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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
BBHouston
Helper I
Helper I

How do I fix this specific measure for my table (cumulative by month)?

I have the following table visual (you can ignore the "Newly Registered" column): 

Screenshot 2020-11-09 154003.png

I want the "Running Count MONTH" total to be cumulative. So instead of 192-54-4, I want it to show up as 192-246-250. Here is my current measure that is still giving me the above result:

Running Count MONTH = CALCULATE(COUNTROWS('Table1'), FILTER(ALL('Table1'[Date]), MONTH('Table1'[Date]) <= MONTH(MAX('Table1'[Date])) && NOT(ISBLANK('Table1'[Date]))))


What mistake is in my measure and how do I fix it to get the result I want? 

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@BBHouston 

The problem is the filter expression, try  use max([date].[month.no]):


Running Count MONTH = CALCULATE(COUNTROWS('Table1'), FILTER(ALLSELECTED('Table1'[Date]), [Date].[Month.no] <= Max([Date].[Month.no]) && NOT(ISBLANK('Table1'[Date]))))


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
V-pazhen-msft
Community Support
Community Support

@BBHouston 

The problem is the filter expression, try  use max([date].[month.no]):


Running Count MONTH = CALCULATE(COUNTROWS('Table1'), FILTER(ALLSELECTED('Table1'[Date]), [Date].[Month.no] <= Max([Date].[Month.no]) && NOT(ISBLANK('Table1'[Date]))))


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_MathurThank you for the reply. Unfortunately, it's giving me the exact same result. I'm guessing i would need to add the MONTH function somewhere there as well? 

jdbuchanan71
Super User
Super User

@BBHouston Give this a try.

Running Count =
VAR _MaxDate = MAX ( 'Table1'[Date] )
RETURN
    CALCULATE (
        COUNTROWS ( 'Table1' ),
        FILTER (
            ALL ( 'Table1'[Date] ),
            'Table1'[Date] <= _MaxDate
                && NOT ( ISBLANK ( 'Table1'[Date] ) )
        )
    )

 

Helpful resources

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