Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.