cancel
Showing results for
Did you mean:
Frequent Visitor

## Help filtering out amounts

Hey Everyone,

I am using the Business Central Jobs fields for this but my goal is I need specific amounts from a field that has 6 values in it and another field that has the Line Amounts.  My goal is I need to have in one column the combined amounts of say Job Task 1 & 3 and Job Task 2 & 4.  Whenever I try to add multiple filters it starts to mess everything up :(.  let me know if you need any more info

i.e. what is in PBI

Line Amount is  = Job_Planning_Lines[Line_Amount]

Job Task #s(All in one field/column)      Line Amounts(All in one field/column)..

1                                                             \$20

2                                                             \$10

3                                                             \$05

4                                                             \$02

5                                                             \$01

6                                                             \$00

What I want

Column NameABC                               Column NameXYZ

Amount for 1 & 3 Combined              \$25

Amount for 1 & 4 Combined              \$22

Any help is much apperciated!

Thanks

1 ACCEPTED SOLUTION
Community Support

Hi, @thomas_coltrain ;

You could create a table then create a measure.

1. enter table

2.create a measure.

``````XYZ =
SWITCH (
MAX ( 'Table'[ABC] ),
"Amount for 1 & 3 Combined",
CALCULATE (
SUM ( Job_Planning_Lines[Line_Amount] ),
FILTER ( ALL ( Job_Planning_Lines ), [Job_Task_no] IN { 1, 3 } )
),
"Amount for 1 & 4 Combined",
CALCULATE (
SUM ( Job_Planning_Lines[Line_Amount] ),
FILTER ( ALL ( Job_Planning_Lines ), [Job_Task_no] IN { 1, 4 } )
)
)``````

The final output is shown below:

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 REPLIES 2
Community Support

Hi, @thomas_coltrain ;

You could create a table then create a measure.

1. enter table

2.create a measure.

``````XYZ =
SWITCH (
MAX ( 'Table'[ABC] ),
"Amount for 1 & 3 Combined",
CALCULATE (
SUM ( Job_Planning_Lines[Line_Amount] ),
FILTER ( ALL ( Job_Planning_Lines ), [Job_Task_no] IN { 1, 3 } )
),
"Amount for 1 & 4 Combined",
CALCULATE (
SUM ( Job_Planning_Lines[Line_Amount] ),
FILTER ( ALL ( Job_Planning_Lines ), [Job_Task_no] IN { 1, 4 } )
)
)``````

The final output is shown below:

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Super User

You can use the following:

`Amount for 1 & 3 = CALCULATE ( SUM ( Table[Line Amounts] ) , FILTER ( 'Table' , Table[Job Task] = "1" && Table[Job Task] = "3" ) )`
`Amount for 1 & 4 = CALCULATE ( SUM ( Table[Line Amounts] ) , FILTER ( 'Table' , Table[Job Task] = "1" && Table[Job Task] = "4" ) )`

If there is issue with the above measure, it is likely associated with the Format of your Job Number.  In the above measure, based on the fact that it is left aligned in your example, I have assumed it is Text format.  If it is Number format, please remove the " " around the 1, 3 and 4 in the measures above.

All the best.
Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Announcements