cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thomas_coltrain
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

Job Task field is = Job_Planning_Lines[Job_Task_no]

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
v-yalanwu-msft
Community Support
Community Support

Hi, @thomas_coltrain ;

You could create a table then create a measure.

1. enter table 

vyalanwumsft_0-1644395843447.png

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:

vyalanwumsft_1-1644395974604.png

 

Please correct me if I understand wrong. I am looking forward to your reply.

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.

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @thomas_coltrain ;

You could create a table then create a measure.

1. enter table 

vyalanwumsft_0-1644395843447.png

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:

vyalanwumsft_1-1644395974604.png

 

Please correct me if I understand wrong. I am looking forward to your reply.

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.

TheoC
Super User
Super User

Hi @thomas_coltrain 

 

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!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors