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
Anonymous
Not applicable

Excel Sumifs to Dax - Help Greatly Appreciated

Hello!

 

In excel I have a SUMIfs. 

 

Col A is employee, B is week number and C is hours. 

 

In column D my sumifs would be:

 

SUMIFS(C:C,A:A,A2,B:B,B2) or sumifs(hours, employee column, A2,week number column, B2)

 

 

EmployeeWeek NumberHours
Dave14
Mark15
Jacob16
Dave26
Jacob15
Jacob24
Mark23

 

I am having desperate trouble replicating this formula in BI.

 

Any tips or help would be greatly appreciated.

 

Thanks

 

WATER

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can try to create measure like DAX below.

 

Measure1= CALCULATE(SUM(Table1[Hours]),FILTER(ALLSELECTED(Table1), Table1[Employee] =MAX(Table1[Employee])&&Table1[Week Number] =MAX(Table1[Week Number])))

 

Best Regards,

Amy

 

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

3 REPLIES 3
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can try to create measure like DAX below.

 

Measure1= CALCULATE(SUM(Table1[Hours]),FILTER(ALLSELECTED(Table1), Table1[Employee] =MAX(Table1[Employee])&&Table1[Week Number] =MAX(Table1[Week Number])))

 

Best Regards,

Amy

 

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

 

 

Anonymous
Not applicable

Many thanks for your help!

 

Water-Hydration

TomMartens
Super User
Super User

Hey,

 

I'm not if I'm missing something, but I think it's not necessary to recreate the Excel formula. Here is a simple Matrix visual:

image.png

 

There is just one thing I changed after copying your sample data to Power BI, as the data type of the week column is recognized as numeric I changed the default summerization of this column to "Don't summarize", just mark the column and change the default summarization:

image.png

This is how Power BI works, it automatically groups categorical (non - numeric) columns and aggregates numerical values, for this reason it's necessary to change the default summarization of the week column.

 

Hopefully this is what you are looking for.

 

Regard,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.