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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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