cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RJD515 Frequent Visitor
Frequent Visitor

Need Help - Measure

Hello,

I am a newbie to Power BI and need some help with a measure i am trying to create.

 

I am trying to get total cost of orders based on a look-up between 2 tables and i have the below but itis not working.

 

Value of Orders = CALCULATE ( SUM ( 'rma mm_standard_cost'[MAX_STD_COST_EA] ), FILTER ( 'rma sr_order_line', 'rma sr_order_line'[PART_NUMBER] = RELATED('rma mm_standard_cost'[MATERIAL]) ) )

 

RMA is the DB

MM Standard Cost is table 1...has Material and MAX_STD_COST_EA as 2 fields

SR Order Line is another table...which has a field called the Part_Number

 

Thanks in advance

Desikan Narayanan

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-sihou-msft
Moderator

Re: Need Help - Measure

@RJD515

 

You may modify you formula like below: 

 

Value of Orders =
CALCULATE (
    SUM ( 'rma mm_standard_cost'[MAX_STD_COST_EA] ),
    FILTER (
        ALL ( 'rma mm_standard_cost'[MATERIAL] ),
        CONTAINS (
            VALUES ( 'rma sr_order_line'[PART_NUMBER] ),
            'rma sr_order_line'[PART_NUMBER], 'rma mm_standard_cost'[MATERIAL]
        )
    )
)

Please also refer to this article: 

 

From SQL to DAX: Joining Tables

 

Regards,

View solution in original post

5 REPLIES 5
RJD515 Frequent Visitor
Frequent Visitor

Need help with a Measure

Hello,

I am trying to write a measure to cauclate the total cost of orders based on materials by looking up the standard cost from another table.

I have the below...but it is not working. Can someone help this newbie pls?

 

Value of Orders = CALCULATE ( SUM ( 'rma mm_standard_cost'[MAX_STD_COST_EA] ), FILTER ( 'rma sr_order_line', 'rma sr_order_line'[PART_NUMBER] = RELATED('rma mm_standard_cost'[MATERIAL]) ) )

 

MM Standard cost has the Material and the cost...SR Order Line has the Part Number that was submitted in the order.

 

Thanks in advance

 

Desi 

Super User IV
Super User IV

Re: Need Help - Measure

Can you share how your tables are related that will help to answer you question. 






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Super User IV
Super User IV

Re: Need help with a Measure

Seems to be a duplicate post 🙂






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Super User IV
Super User IV

Re: Need help with a Measure

Hi @RJD515,

 

Share the link from where i can download your file.  Show the expected result/visual that you want.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Moderator v-sihou-msft
Moderator

Re: Need Help - Measure

@RJD515

 

You may modify you formula like below: 

 

Value of Orders =
CALCULATE (
    SUM ( 'rma mm_standard_cost'[MAX_STD_COST_EA] ),
    FILTER (
        ALL ( 'rma mm_standard_cost'[MATERIAL] ),
        CONTAINS (
            VALUES ( 'rma sr_order_line'[PART_NUMBER] ),
            'rma sr_order_line'[PART_NUMBER], 'rma mm_standard_cost'[MATERIAL]
        )
    )
)

Please also refer to this article: 

 

From SQL to DAX: Joining Tables

 

Regards,

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors