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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
lorenacardona
Frequent Visitor

Calculate Column in New table

Hi,

 

I want to make a new table that for a specific name gives me the sum of hours that they work.

 

So I already filter the names with this formula:   Pilotos = DISTINCT(Jornadas[Crew Name])

 

The problem is that i dont know how to make the fomula that sum the hours if the name at Table A is the same name at Table B.

 

I was trying with this formula:   Column = CALCULATE(SUM(Jornadas[Jornada]),FILTER(ALL(Jornadas[Crew Name])))

 

Regards!

1 ACCEPTED SOLUTION

Hi @lorenacardona

 

I think you have a bracket in the wrong place.  Please try this..

 

Horas = CALCULATE(SUM(Jornadas[Jornada]),RELATEDTABLE('Jornadas'))

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

5 REPLIES 5
v-chuncz-msft
Community Support
Community Support

@lorenacardona,

 

By the way, you may also use SUMMARIZE Function.

Table =
SUMMARIZE ( Jornadas, Jornadas[Crew Name], "Horas", SUM ( Jornadas[Jornada] ) )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Phil_Seamark
Employee
Employee

Hi @lorenacardona

 

If you have created a calcuated column as you say, just create a relationship between your existing table and your new table as follows

 

relationship.png

 

Then you can add the following calcuated column to your Pilotos table

 

Column = CALCULATE(
                SUM(Jornadas[Jornada]),
                RELATEDTABLE('Jornadas')
                )

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

I already made the relation between the two tables and this message appears when I put the formula:

 

Horas = CALCULATE(SUM(Jornadas[Jornada],RELATEDTABLE('Jornadas')))

 

"Too many arguments were passed to the SUM function. The maximum argument count for the function is 1."

 

Thanks!

Hi @lorenacardona

 

I think you have a bracket in the wrong place.  Please try this..

 

Horas = CALCULATE(SUM(Jornadas[Jornada]),RELATEDTABLE('Jornadas'))

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

@Phil_Seamark it worked! thank you so much for everything.

 

You really helped me.

 

Regards!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.