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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Syndicate_Admin
Administrator
Administrator

Adding through multiple criteria

Hello everyone.

Of course thank you for any help. I am struggling to do the following: I have the challenge of adding up the amounts of an expense, but I must do it through several criteria. The main catalog has two columns, ACCOUNT | KEY1 and this one emerges several possible combinations, the image that I attach can help to understand what I want to do, what is in red is what would correspond to the expense.

Could I do it with DAX?. I have three valid cases to take the expense:

1. ACCOUNT y KEY1

2. Solo ACCOUNT

3. Key1 only

gasto.png

In the example the total would be $670

Thanks for any help

1 ACCEPTED SOLUTION
isabella
Microsoft Employee
Microsoft Employee

Hi @Syndicate_Admin 

About your first criteria ,you can merge the two table like this in power query .

isabella_0-1655099993606.png

 

Then expand table like this  :

isabella_1-1655099993607.png

 

 

Now table is like this

isabella_2-1655099993611.png

 

 

Regarding to your second criteria,base on the upper ,still merge

isabella_3-1655099993612.png

 

isabella_4-1655099993615.png

 

 

 

Then expand like this:

isabella_5-1655099993616.png

 

Now the table is like this:

isabella_6-1655099993618.png

 

 

And about the third criteria , same as upper ,but this time merge base on key1 field

 

 

 

Best Regards,

Community Support Team _Isabella

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

2 REPLIES 2
isabella
Microsoft Employee
Microsoft Employee

Hi @Syndicate_Admin 

About your first criteria ,you can merge the two table like this in power query .

isabella_0-1655099993606.png

 

Then expand table like this  :

isabella_1-1655099993607.png

 

 

Now table is like this

isabella_2-1655099993611.png

 

 

Regarding to your second criteria,base on the upper ,still merge

isabella_3-1655099993612.png

 

isabella_4-1655099993615.png

 

 

 

Then expand like this:

isabella_5-1655099993616.png

 

Now the table is like this:

isabella_6-1655099993618.png

 

 

And about the third criteria , same as upper ,but this time merge base on key1 field

 

 

 

Best Regards,

Community Support Team _Isabella

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

amitchandak
Super User
Super User

@Syndicate_Admin , You can have a calculated column in the second table

 

sumx(filter(Transact, Transact[key1] = catalog[Key1]), Transact[Amount])

 

 

or

 

sumx(filter(Transact, Transact[key1] = catalog[Key1] && Transact[Account] = catalog[Account] ), Transact[Amount])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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.