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.
hi all,
I consider myself an advanced beginner dax user and Im having a hard time with this one. suppose i have 2 tables: order table and sales table as below. the red numbers represent the values I want to calculate in a calculated column.
order table sales table
order # kit flag amount order # summed amt
1 c $11 1 $24
2 c $12 1 $24
1 c $13 2 $12
2 p $14 3 $0
3 p $15 3 $0
4 p $16 3 $0
4 c $17 4 $35
4 c $18 4 $35
1 p $19 1 $24
The two tables are connected through a many to many relationship on the order number field. what i want to do is create a calculated column in the sales table that sums up the amount in the order table for any matching order number that has a kit flag of "c".
I apppreciate the help
Solved! Go to Solution.
Hi @CL7777
Kit C sum = Calculate(SUM('order'[amount]),sales[Order#]=order[order#] && order[kit flag]="c")
or
Kit C sum = Calculate(SUM('order'[amount]),FILTER(ALLEXCEPT(sales[Order#]),order[kit flag]="c"))
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
Hi @CL7777 ,
Try this:
summed amt =
VAR amt =
CALCULATE (
SUM ( 'Order Table'[amount] ),
FILTER (
ALLEXCEPT ( 'Order Table', 'Order Table'[order#] ),
'Order Table'[kit flag] = "c"
)
)
RETURN
IF ( ISBLANK ( amt ), 0, amt )
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@CL7777 , Try a formula like, new column in sales
sumx(filter(Order,Order[Order#] = Sales[Order#] && Sales[kit flag] ="c"),Order[amount])
Hi,
Try this calculated column formula in the Sales table
=calculate(sum('Order'[amount]),filter('order','order'[order #]=earlier('order'[order #])&&'order'[kit flag]="c"))
Hope this helps.
Hi @CL7777 ,
Try this:
summed amt =
VAR amt =
CALCULATE (
SUM ( 'Order Table'[amount] ),
FILTER (
ALLEXCEPT ( 'Order Table', 'Order Table'[order#] ),
'Order Table'[kit flag] = "c"
)
)
RETURN
IF ( ISBLANK ( amt ), 0, amt )
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @CL7777
Kit C sum = Calculate(SUM('order'[amount]),sales[Order#]=order[order#] && order[kit flag]="c")
or
Kit C sum = Calculate(SUM('order'[amount]),FILTER(ALLEXCEPT(sales[Order#]),order[kit flag]="c"))
Hope it resolves your issue? Did I answer your question? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!! Linkedin Profile |
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |