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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PBI_newuser
Post Prodigy
Post Prodigy

How to calculate Cumulative Count based on Bin

Hi, how to create the cumulative job count by using Bin? Here is the sample data.

 

Table:

JobHoursBin
J-1          120-12
J-2          100-12
J-3          3937-48
J-4          1813-24
J-5          2525-36
J-6          8785-96
J-7          4037-48
J-8          4237-48
J-9          3837-48
J-10          3425-36
J-11          1913-24
J-12          6561-72
J-13          6661-72
J-14          7973-84
J-15          5549-60

 

Expected Output:

BinJob CountCumulative Count
0-1222
13-2424
25-3626
37-48410
49-60111
61-72213
73-84114
85-96115
1 ACCEPTED SOLUTION

Try This:

 

CumulativeJobCount =
CALCULATE (
    [JobCount],
    FILTER (
        ALLSELECTED ( JobTable ),
        JobTable[BinOrderIndex] <= MAX ( JobTable[BinOrderIndex] )
    )
)

View solution in original post

9 REPLIES 9
MohammadLoran25
Solution Sage
Solution Sage

Hi @PBI_newuser ,

Assume your table name is JobTable.

Follow steps below:

 

1-Create a Calculated Column:

 

BinID = CONVERT(SUBSTITUTE(JobTable[Bin],"-","") ,INTEGER)
 
2-Create a Calculated Column:
 
BinOrderIndex = RANKX(JobTable,JobTable[BinID],JobTable[BinID],ASC, DENSE)
 
3-Create a measure:
 
JobCount = COUNT(JobTable[Job])
 
Then your Cumulative measure would be like:
 CumulativeJobCount =
CALCULATE (
    [JobCount],
    FILTER (
        ALL ( JobTable ),
        JobTable[BinOrderIndex] <= MAX ( JobTable[BinOrderIndex] )
    )
)
 
If this answer solves your problem, please mark it as an accepted solution so the others would find what they need easier.
Regards,
Loran

Hi @MohammadLoran25 , I tried to use the suggested column/measure but it doesn't work when I select product. Here is sample data.

PBI_newuser_0-1679564462307.png

 

You have not provided any info about your product table and its relationship with your JobTable.

Please Provide more details.

Hi @MohammadLoran25 , I want the cumulative count calculate based on the product selected. For example, when I select Product D, the job count for "0-24" bin is 4 and the cumulative count need to be 4 also. 

I understood.

But what is your data model? What is the relationship between Product table and sample data you provided?

Can you access to the pbix file here to see the data model?

https://drive.google.com/file/d/1xYKKBobGldw1SmNq0tC9ddkg4YkzxBeX/view?usp=sharing

Try This:

 

CumulativeJobCount =
CALCULATE (
    [JobCount],
    FILTER (
        ALLSELECTED ( JobTable ),
        JobTable[BinOrderIndex] <= MAX ( JobTable[BinOrderIndex] )
    )
)

@MohammadLoran25  It works!!! Thank you sooooooooo much 🙂

You're welcome.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors