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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

how to rename several columns with a function UNION and SUMARIZE ?

Hello,

 

I did not understand the found message in your site for same question that this...

 

because, I developped the simple function union and sumarize with the same name of columns for 2 or several tables. It works well.

 

Now, I developp using this function with the different names of columns. how do to do it ?

  

----

Table Map1 = VAR mytable =
UNION (
SUMMARIZE ( Change_ref; Change_ref[Number];Change_ref[Users_ref.conso_entity];Change_ref[Planned end date];"Change");
SUMMARIZE ( incidents_ref;incidents_ref[Number];incidents_ref[GIO Entity Code];incidents_ref[Opened];"incident" )
 
)
Return
SELECTCOLUMNS(mytable; "Number"; [Number];"Name_Entity";[Name_Entity];  ==> this isn't well !...there is an displayed error.
 
I would like as in a SQL
(Select 
Change_ref[Number]  as Number ;
Change_ref[Users_ref.conso_entity] as Name_Entity;
Change_ref[Planned end date] as "W_Date";
"Change" as "Typ_Doc")
from Change_ref )
UNION (
Select
incidents_ref[Number] as "Number";
incidents_ref[GIO Entity Code] as "Name_Entity";
incidents_ref[Opened] as "W_Date";
"incident" as "Typ_Doc" 
from incidents_ref)
 
How do to do it in Dax ?
 
Thank you in advance for your help 
sincerely
3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please update your formula like that.

Table Map1 = 
VAR mytable =
    UNION (
        SUMMARIZE (
            Change_ref,
            Change_ref[Number],
            Change_ref[Users_ref.conso_entity],
            Change_ref[Planned end date],
            "a", "Change"
        ),
        SUMMARIZE (
            incidents_ref,
            incidents_ref[Number],
            incidents_ref[GIO Entity Code],
            incidents_ref[Opened],
            "b", "incident"
        )
    )
RETURN
    SELECTCOLUMNS (
        mytable,
        "Number", [Number],
        "Name_Entity", [Users_ref.conso_entity],
        "aaa", [a]
    )

Capture.PNG

 

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

hi,

 

Thank you for your answer.

I didn't understand it .

Because, I don't see how to fill in from 3 last differents columns to "selectcolumn"!...

a1.pngtables

Normalement, we Should put the same orders of the columns with respect to the 2 origin tables ... 

But there, I noticed  that a column is missing !...

 

how to do to fill in the final table from severals columns with differentsnames of columnes of differents tables ?  

Hi @Anonymous ,

 

Kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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