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
Paulyeo11
Impactful Individual
Impactful Individual

How to create SEGMENT_C field at SALES Table ?

Hi All

I have try below , it cannot work :-

SEGMENT_C = SUM('Z_SEGMENT'[SEGMENT_C])

Paulyeo11_0-1606452197273.png

 

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Paulyeo11 ,

In power bi, different columns from different tables could not be moved directly if there are no related columns in these tables as @ amitchandak mentioned.

If these tables have related columns(relationship is optional), you can add a new column in another table.

For example, Here is table 1 and table2 which have related fields [ID]:
table1table1table2table2

Now I want to create a new [Sales] column in table 2 which calculates the total sales for each ID, create a calculated column like this:

Column = 
CALCULATE (
    SUM ( 'Table 1'[Sales] ),
    FILTER ( ALL ( 'Table 1' ), 'Table 1'[ID] = EARLIER ( 'Table 2'[ID] ) )
)

 column.png

Attached the sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yingjl
Community Support
Community Support

Hi @Paulyeo11 ,

In power bi, different columns from different tables could not be moved directly if there are no related columns in these tables as @ amitchandak mentioned.

If these tables have related columns(relationship is optional), you can add a new column in another table.

For example, Here is table 1 and table2 which have related fields [ID]:
table1table1table2table2

Now I want to create a new [Sales] column in table 2 which calculates the total sales for each ID, create a calculated column like this:

Column = 
CALCULATE (
    SUM ( 'Table 1'[Sales] ),
    FILTER ( ALL ( 'Table 1' ), 'Table 1'[ID] = EARLIER ( 'Table 2'[ID] ) )
)

 column.png

Attached the sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Paulyeo11
Impactful Individual
Impactful Individual

Hi Ying

Thank very much for your sharing. I can understand what you try to do. 

Paul

amitchandak
Super User
Super User

@Paulyeo11 , a column can not be moved. If they have some relation value can be copied: https://www.youtube.com/watch?v=czNHt7UXIe8

 

measure can move - refer a prt of this video -https://www.youtube.com/watch?v=b9oDIL8nbu0

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.