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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Calculate total costs per product

Hello everyone,

I need help with DAX measure to calculate total cost per product/tariff. Namely, in the table "Customers" i have different tariffs with coresponding users in number column. I need to take the cost per tariff from the table "Content Costs" column "Cost" and multiply with the number of customers. The result should be total costs per tariff.

I tried with the sumx, 

Total Content Costs = sumx(Customers,Customers[Number]*[Content costs per package]),  where 
Content costs per package = sum('Content Cost'[Cost]), but i dont get any result.
The .pbix file with the data model is at the following link: Total cost in tariff 
Thanks a lot,
Goran

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,


Is this the result?

b11.PNG

//in 'Customer' table
Column = 
LOOKUPVALUE(
    'Content Cost'[Cost],
    'Content Cost'[Customer Layer], Customers[Customer Layer],
    'Content Cost'[Package], Customers[Package],
    'Content Cost'[Product Layer], Customers[Product Layer],
    'Content Cost'[Technology], Customers[Technology]
    )

Column 2 = [Column] * [number per Package per product]


Regards,
Lionel

View solution in original post

4 REPLIES 4
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

Is this what you want to calculate?

Cost per package per product = 
CALCULATE(
    SUM('Content Cost'[Cost]),
    ALLEXCEPT(
        'Content Cost',
        'Content Cost'[Package], 'Content Cost'[Product Layer]
    )
) 

number per Package per product = 
CALCULATE(
    SUM(Customers[Number]),
    ALLEXCEPT(
        Customers,
        Customers[Package],Customers[Product Layer]
    )
)

total cost per product = [numbers per Package per product] * [Cost per package per product]

 

Best regards,
Lionel Chen

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



 

Anonymous
Not applicable

Hi,

Thanks for your support. Unfortunattely, the proposed solution gives wrong results. For example, the correct results for the selection Residential ->TV -> Fix ->optic -> Optic has 86 customers and multiplied by the costs should result in 21.500, not 417.960 as in the screenshot below.Untitled.jpg

thanks,

Goran

Hi @Anonymous ,


Is this the result?

b11.PNG

//in 'Customer' table
Column = 
LOOKUPVALUE(
    'Content Cost'[Cost],
    'Content Cost'[Customer Layer], Customers[Customer Layer],
    'Content Cost'[Package], Customers[Package],
    'Content Cost'[Product Layer], Customers[Product Layer],
    'Content Cost'[Technology], Customers[Technology]
    )

Column 2 = [Column] * [number per Package per product]


Regards,
Lionel

Anonymous
Not applicable

Thank you, it worked!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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