Reply
Vamshi2020
Helper II
Helper II
Partially syndicated - Outbound

Cumulative Distinct count based on months

Hi Everyone ,

 

I have a Requirement to show Cumulative count based on "Month -Year" in Line chart . Based on selections in Dim Date slicer, my value should change . My Actual count formula is :
Count= 
var a=MINX(DimDate,DimDate[Date])
var b=MAXX(DimDate,DimDate[Date])
var c=calculate(Distinctcount(MemberTable[MemberId]),Filter(MemberTable , MemberTable[StartDate]<=b && MemberTable[EndDate]>=a))
return c

The above formula is giving the proper results, but in other line chart i want to see cumulative count for each months.

So i wrote like below:

Cumulative =Calculate(MemberTable[Count],DATESYTD(DimDate[Date],"31/12")

 

But this is not working , 

 

Please help me with the requirement .

TIA

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Syndicated - Outbound

Hi @Vamshi2020 ,

 

Try this:

Cumulative Count =
VAR a =
    MINX ( ALLSELECTED ( DimDate ), DimDate[Date] )
VAR b =
    MAXX ( DimDate, DimDate[Date] )
VAR c =
    CALCULATE (
        DISTINCTCOUNT ( MemberTable[MemberId] ),
        FILTER ( MemberTable, MemberTable[StartDate] <= b && MemberTable[EndDate] >= a )
    )
RETURN
    c

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

Syndicated - Outbound

Hi @Vamshi2020 ,

 

Try this:

Cumulative Count =
VAR a =
    MINX ( ALLSELECTED ( DimDate ), DimDate[Date] )
VAR b =
    MAXX ( DimDate, DimDate[Date] )
VAR c =
    CALCULATE (
        DISTINCTCOUNT ( MemberTable[MemberId] ),
        FILTER ( MemberTable, MemberTable[StartDate] <= b && MemberTable[EndDate] >= a )
    )
RETURN
    c

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

amitchandak
Super User
Super User

Syndicated - Outbound

@Vamshi2020 , with two dates to me it seem like a case like my HR blog current employee.

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)