Forum Discussion
How to filter a measure by all values
So currently I have DAX code as follows:
Measure = sumx(FILTER(Qty, Qty[ID #] = "53101"), [Sales])
This correctly sums up all the sales for a given ID. However, I want to do this for all sales across all IDs. How do I do this? Also, sales is a measure and not a column if that makes a difference.
12 Replies
- ibarrau
Super User
Hi there. I'm sorry, but you should tell us more details about tables and the measure sales in order to help. If you just need sum a column of a table with and axis of another table, just relate them in Relationships View. Then you can add the columns in a single visualization set the numeric one to sum and you are ready to go.
Regards,
- mumair
Helper I
Let's say my table looks like this
ID # | Sales Amount
01 | 2
01 | 3
01 | 3
01 | 5
01 | 1
01 | 3
02 | 5
02 | 6
02 | 3
03 | 3
03 | 1
I want ONE DAX function that will sum up the sales amount per ID number. This data is hypothetical. My real dataset is much longer and has more columns, but for the time being, I am only concerned about these two particular columns. The sales amount is measure generated from another table.
- ibarrau
Super User
Ok, that is not the table or an example of it because the measure is not from the table. Tell us the two tables involved, how are they related. Because at now, there is no problem. You can add the id and the measure to any visualization and it will work. Axis = not sumarize id and Value = Sales. You can make table, bar chart, etc.
Regards,