Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi Team,
I want your help in writing a dax query. My requirement is given below -
My data
segement | sales | manufacturer |
midsize uv | 100 | A |
midsize uv | 200 | B |
premium full size | 400 | B |
expected sum 300 since ONLY midsize uv is the part of A |
I want to find out the sum of sales for all those segments where manufacturer is equals to A e.g midsize UV is the part of A manufacturer so total sum of sales would be 100 +200 = 300. premium full size is not part of A so it is ignored
Solved! Go to Solution.
@SagarJagga ,Please try this formula
Proud to be a Super User! |
|
@SagarJagga ,Please try this formula
Proud to be a Super User! |
|
Hi Gautam,
Getting an error "A table of multiple values was supplied where a single value was expected"
@SagarJagga , You can create a measure for this
SumOfSalesForA =
CALCULATE (
SUM ( YourTable[sales] ),
FILTER (
YourTable,
YourTable[segment] IN {
SELECTCOLUMNS (
FILTER (
YourTable,
YourTable[manufacturer] = "A"
),
"segment", YourTable[segment]
)
}
)
)
Proud to be a Super User! |
|
Thanks for your help, just wanted to know why selectColumn has not worked.
Much appreciated
Hi Gautam,
Actually we have multiple segments which are coming under manufacturer A. so it is throwing an error "A table of multiple values was supplied where a single value was expected"
User | Count |
---|---|
13 | |
8 | |
8 | |
7 | |
5 |
User | Count |
---|---|
21 | |
15 | |
15 | |
10 | |
7 |