cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Filtering SUM Value Based on Another Measure

Hi All!

i am trying to multiply the amount of days a piece of equipment was on a project by the AVG. cost of that equipment to achieve a total cost of plant on project.

the current formula to calculate Total project cost of plant is:

Total Project cost for Plant = DayDiaryPlantList_Sharepoint[Day Diary Plant Days] * SUM(Plant[AVG. Plant & Vehicle Cost Per day]) but that appears to be summing all AVG Values; it then applies those values to the project

the problem i am experiencing is that Total Project Cost for Plant is Multiplying the Total sum of "Day Diary Plant Days" by the Total Sum of "AVG. Plant & Vehicle cost per day" so the total being applied is \$1921.39 instead of the desired \$65.87.

my data structure is below; with cost values being from the APPosted Invoices Query; and day docket master and plant list being the fact tables for project and plant;

total plant days is calculated by:
Day Diary Plant Days = CountRows(Filter(DayDiaryPlantList_Sharepoint,CONTAINS(DayDiaryMaster_Sharepoint,DayDiaryMaster_Sharepoint[Id],DayDiaryPlantList_Sharepoint[MasterID])))

Master list of Projects is in the Project Query, and master list of Equipment is in "Plant" Query

kind regards,

James

1 ACCEPTED SOLUTION
Community Support

12605 is 2521*5, that is, the total of AVG Plant Cost per Day is multiplied by the total of Assigned Equipment Days.

You can create a new measure to get the results you want.

``Measure = SUMX('Equipment List',[Plant Assigned Cost])``

Best Regards,

Stephen Tao

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

4 REPLIES 4
Super User

Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.

Frequent Visitor

Hi @lbendlin,

Thanks for getting in touch on this one; i have created a simplified and Sanitised Data model which can be viewed below:

The outcome i would like to achieve is

AVG plant cost per day * Assigned equipment days;

wherein apply the average daily cost of a piece of equipment (which is referencing the Invoices Column) and apply that value average value to a project whenever the piece of equipment is assigned to the project (using the day diary)

as you can see in the image below, it appears to be filtering and applying the values correct, but the total value for "Plant assigned cost" doesnt seem to add up properly;

the cost that i want applied to the project is 1502.67+641.33+1449.00 = \$3593.00 but instead the total is \$12605.00 and i cant figure out why?

Community Support

12605 is 2521*5, that is, the total of AVG Plant Cost per Day is multiplied by the total of Assigned Equipment Days.

You can create a new measure to get the results you want.

``Measure = SUMX('Equipment List',[Plant Assigned Cost])``

Best Regards,

Stephen Tao

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

Frequent Visitor

Thankyou so much Stephen!

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors