cancel
Showing results for
Did you mean:
Frequent Visitor

SUMX -> month

Hi all!

Hope you all have a nice weekend so far!

I'm currently struggling with a SUMX measure.

I want to calculate a cost based on the number of hours spent.

-> in January -> 6 of 150 hours = 4% -> total cost is 6.070 so cost for this item is 243

-> in Februry -> 23 of 164,25 hours = 14% -> total cost is 6.070 so cost for this item is 850

=> total for January and Februari is 1.093 and not 1.120

(1.120 = 12.139 x 9,23%)

Current measure: RESULT = SUMX(Emp, [TOTAL] * [HOURS %])

Thanks a lot!

M

4 REPLIES 4
Anonymous
Not applicable

Hi,

well, DAX is calculate the SUM too, and here is your problem, not the result column.
So, try to use matrix and not the table and see how you can change the sum, or switch off the sum and use card for your total result.

Frequent Visitor

Sorry, don't get it.

I'm using a matrix. The 'end result' isn't correct, so using a card do really solve the problem? 😕

Frequent Visitor

Here is a sample pbix file: https://1drv.ms/u/s!Akj7bUrQd6tMxFD0imuPrUg3lld5?e=lUTWkD

Resolver IV

Here you are:

``````RESULT =
VAR __table =
SUMMARIZE(
Emp,
Emp[Month]
),
"@result", CALCULATE(DIVIDE(SUM(Emp[HOURS]), SUM(Emp[HOURS TOTAL])) * SUM(Emp[TOTAL]))
)
RETURN
sumx(__table, [@result])``````

Announcements

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors