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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
JonasDedual
Helper I
Helper I

Sumx with filter over another Table

Hi All

 

I am exactly requiring what microsoft is showing in below example:

https://docs.microsoft.com/en-us/dax/sumx-function-dax

 

The only differnece is that I need the filter from table "Lian CH$Item" and the summerize is for the Table Lian CH$Sales Invoice Line

JonasDedual_0-1616584463893.png

 

 

However, I noticed that I only can use measures for the sumx but not Quantity as I would like:

 

But this is giving me an Error.

JonasDedual_1-1616586563625.png

DAX:

Turnover OTC (Number) Spread orders current year vs. last year (Number) = SUMx(FILTER('Lian CH$Item','Lian CH$Item'[Item Group Code] = "A-Liste-C"),'Lian CH$Sales Invoice Line'[Quantity])

 

 

any Idea what I am doing wrong?

 

I would like to have for each customer the total of ammount ordered.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@JonasDedual , Try like

 

Turnover OTC (Number) Spread orders current year vs. last year (Number) = CALCUALTE(SUM('Lian CH$Sales Invoice Line'[Quantity]),FILTER('Lian CH$Item','Lian CH$Item'[Item Group Code] = "A-Liste-C"))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @JonasDedual  ,

According to your description, I create some data:

Table:

v-yangliu-msft_0-1616745584964.png

Table2:

v-yangliu-msft_1-1616745584965.png

Here are the steps you can follow:

The column of the second parameter of Sumx must come from the table in the first parameter. You can also use the RELATED() function to pull the column of another table

1. Create calculated column.

Column =
SUMX(FILTER('Table','Table'[group]="A"),RELATED('Table (2)'[value]))

2. Result.

v-yangliu-msft_2-1616745584968.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

@JonasDedual , Try like

 

Turnover OTC (Number) Spread orders current year vs. last year (Number) = CALCUALTE(SUM('Lian CH$Sales Invoice Line'[Quantity]),FILTER('Lian CH$Item','Lian CH$Item'[Item Group Code] = "A-Liste-C"))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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