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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
EsterBR
Helper II
Helper II

Total Cost

Hi,

 

I have the following table:

EsterBR_0-1714467700864.png

I have the following formula to get the sum the cost per day of the employee without taking into account the date. It is to say if a cost per day of an employee is 104,32 the sum of his cost will be always 104,32 and NOT the sum of his cost per day for all the year (104,32*365).

Employee Cost  = 
CALCULATE(
    SUM('Table'[Cost]), 
    FILTER(
        ALL('Table'), 
        'Table'[Date] = MAX('Table'[Date]) 
        && 
        'Table'[Team] = MAX('Table'[Team])
    )
)

So the result is the following:

EsterBR_1-1714467855650.png

I am trying to sum the total cost of the Employee Cost , but the result is not correct.

Employee Cost Total = (CALCULATE([Employee Cost ],ALL()))
 
How can I achieve this?
 
Thanks!

 

 

 

 

2 REPLIES 2
v-jialongy-msft
Community Support
Community Support

Hi @EsterBR 

 

Can you provide detailed sample pbix file and the results you expect.So that I can help you better. Please remove any sensitive data in advance.

 

 

 

 

Best Regards,

Jayleny

Hi,

 

I finally solved it by the following measure:

 

Employee Cost  = 
CALCULATE(
    SUM('Table'[Cost]), 
    FILTER(
        ALL('Table'), 
        'Table'[Date] = MAX('Table'[Date]) 
    )
)

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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