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

View all the Fabric Data Days sessions on demand. View schedule

Reply
dodolabs
Regular Visitor

Count the numbers in a column depending on other columns

Hi everyone,

I'm trying to create a formula but i need some help.

I have a table with a list of support hours, support categories and dates.

Something like this:

Support hour     support category      date
11                      Type 1                       2020.01.19
15                      Type 2                       2020.02.05
6                        Type 2                       2019.08.06
9                        Type 1                       2020.01.08
4                        Type 1                       2019.11.22

My goal is to count the support hours of different support category for each month:
Type 1:
2019.11: 4
2020.01: 20

Type 2:
2019.08: 6
2020.02: 15


I've tried measures but without success.
Thank you all

1 ACCEPTED SOLUTION

Hi @dodolabs ,

 

Please try the dax below:

Measure = CALCULATE(SUM(Sheet4[Support hour]),ALLEXCEPT(Sheet4,Sheet4[support category],Sheet4[Year_month]))

The sample pbix has updated.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
V-lianl-msft
Community Support
Community Support

Hi @dodolabs ,

 

If your calendar is data in date format, you may not need to use DAX, just add a category slicer.

You can also format the year and month.

Year_month = FORMAT(Sheet4[date],"YYYY.MM")

test_sum_hour.PNG

Here is the sample pbix.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

az38
Community Champion
Community Champion

Hi @dodolabs 

try a measure

Measure= CALCULATE( SUM(Table[Support hour]), ALLEXCEPT(Table, Table[support category], Table[date]) )

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Hi!

 

Thanks, but how can I get the sum of each support category and month?

I think I need measure for every month and category.

The category column can have more than two categories, and of course there can be more dates in the date column

 

for example:
Category 1:
2019.11 (sum): 4
2020.01 (sum): 20

 Category 2:
2019.08 (sum): 6
2020.02 (sum): 15

 

Category 3:

2019.01.04 (sum): 27

2019.05.10 (sum): 67

2020.01.03 (sum): 6

2020.02.27 (sum): 2

Hi @dodolabs ,

 

Please try the dax below:

Measure = CALCULATE(SUM(Sheet4[Support hour]),ALLEXCEPT(Sheet4,Sheet4[support category],Sheet4[Year_month]))

The sample pbix has updated.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you for your help!

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
Top Kudoed Authors