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
Fabio
Regular Visitor

SUM of hours based on distinct values in another column

 Hello, 

 

I have the table below and I´m Trying to construct a DAX formula to calculate the total of Killometers traveled and the total of hours worked from distinct ID´s, I was able to do it on the Killometers column using 2 measures

1: Kmrodados_1 = MAXX(DISTINCT(Registros[ID Viagem]);MAX(Registros[Km Rodados]))

2: Kmrodados_2 = SUMX(DISTINCT(Registros[ID Viagem]);[Kmrodados_1])

But when I tried the same formula in the period column I can have the total if I split in months for example, but I can´t get the total of everything.

 

aaaaa.JPG

 aaaaaaaaa.JPG

Thanks in advace,

 

Fábio

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @Fabio,

 

Current power bi not support to use math functions calculate on date/time type, maybe you can consider to convert time type as total seconds to calculate total time.

 

Regards,

Xiaxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Fabio
Regular Visitor

Can anyone help me with that? 

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.