Forum Discussion
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 Month | Org Id |
| 1 | Other |
| 2 | Other |
| 3 | Other |
| 4 | Other |
| 5 | Other |
| 6 | Other |
| 7 | Other |
| 8 | Other |
| 9 | Other |
| 10 | Other |
| 11 | Other |
| 12 | Other
|
What i need is like below :
| Fiscal Month | Org Id | DISTINCT COUNT(Org Id) | Running Sum |
| 1 | Other | 1 | 1 |
| 2 | Other | 1 | 2 |
| 3 | Other | 1 | 3 |
| 4 | Other | 1 | 4 |
| 5 | Other | 1 | 5 |
| 6 | Other | 1 | 6 |
| 7 | Other | 1 | 7 |
| 8 | Other | 1 | 8 |
| 9 | Other | 1 | 9 |
| 10 | Other | 1 | 10 |
| 11 | Other | 1 | 11 |
| 12 | Other | 1 | 12 |
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
- VvelardeCommunity Champion
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
- AadiNew Member
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. :mansad: