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
Aadi
New Member

Count and then running Sum functionality in Power BI

Hi Experts,

 

Need your help here :

 

I have two coloumns "Fiscal Month" and "Ord ID" . My requirement is to take the "count of Org Id" and then Take the running sum of that "count of Org Id". 

 

Count of Org Id is simple by creating a measure "DISTINCTCOUNT (Org Id)" but iam not able to take the running sum on top of this  "DISTINCTCOUNT (Org Id)"  . Please help 

 

Base table :

 

Fiscal MonthOrg Id
1Other
2Other
3Other
4Other
5Other
6Other
7Other
8Other
9Other
10Other
11Other
12

Other

 

 

 

What i need is like below :

 

Fiscal MonthOrg IdDISTINCT COUNT(Org Id)Running Sum
1Other11
2Other12
3Other13
4Other14
5Other15
6Other16
7Other17
8Other18
9Other19
10Other110
11Other111
12Other112

 

For Running sum i have use the below Logic, but this is not giving me the correct result .

 

Count cumulative =
CALCULATE (
DISTINCTCOUNT('Sheet1'[Org Id]),
FILTER (
ALL ( Sheet1 ),
'Sheet1'[Fiscal Month]<= MAX ( 'Sheet1'[Fiscal Month] )
)
)

 

 

Appreciate you response at the earliest .

 

Thanks

2 REPLIES 2
Vvelarde
Community Champion
Community Champion

 

@Aadi

 

 

Hi, use this DAX Measure

 

RunningCount =
SUMX (
    FILTER ( ALL ( Table1 ), Table1[Fiscal Month] <= MAX ( Table1[Fiscal Month] ) ),
    DISTINCTCOUNT ( Table1[Org Id] )
)

 

Regards

 

Victor

Lima - Peru




Lima - Peru

Thanks Victor for your reply.

 

This is working with Excel datasource but same when i connect to HADOOP iam not getting the desired result. It just gives me the DistinctCount ie Value 1 for all months. Man Sad

 

 

 

 

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.

Top Solution Authors