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
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
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.