cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Vamshi2020
Helper II
Helper II

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

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

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

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors