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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Summarize problems

Hello all,

 

I am having again an issue, probably pretty simple.

 

I need the sum of 2 different columns from 2 different tables.

Tried different options, but i won't get the wright solution in my visual.

 

-I have 2 columns from 2 different tables.

Table 1 [Column Distance]

Table 2 [Column Flat Distance]

 

-I Need a new Column named [Total Distance]

So the Sum between Distance + Flat Distance.

 

Now i am, having the formula:

Totale Afstand = calculate(sum(Table 1[Distance])+sum(Table 2[Flat Distance]))
 
But my result looks like a summup of all the numbers of this column Total Distance.
From al the Columns is the Data Type = Whole Number
No summarize
 
Table 1 Table 2 Expected Result now
Distance DIstance Flat
100 25 125 951669
150 5 155 951669
100 75 175 951669
200 100 300 951669
185 20 205 951669
200 50 250 951669
250 75 325 951669

 

 

Do you guys have an idea?

 

 

Thanks,

 

 

 

 

 

 

 

6 REPLIES 6
Anonymous
Not applicable

Good mornig,

 

Does somebody else, has any idea?

I'am stuck.

 

Gr,

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but if you are looking for creating a new table, please check the below picture and the attached pbix file.

 

Jihwan_Kim_1-1664890200260.png

 

 

 

Jihwan_Kim_0-1664890175320.png

 

New Table = 
SUMMARIZE (
    ADDCOLUMNS (
        GENERATE ( Table1, FILTER ( Table2, Table2[ID] = Table1[ID] ) ),
        "@Total Distance", Table1[Distance] + Table2[Distance Flat]
    ),
    Table1[Distance],
    Table2[Distance Flat],
    [@Total Distance]
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

Hello Jihwan,

 

Thank you for your response.

 

Unforunatly i becom an error when i will use your text:

 

MeAlfons_0-1664896925574.png

 

I added a newe column and putted your text in here.

 

Is this the wright way?

 

 

Gr

Hi,

Thank you for your message.

I am not sure how to check it without seeing your datamodel, but I see that you put that as a calculated column. My DAX formula is for creating a table, not a column.

Please share your sample pbix file's link, and then I can try to look into it to come up with a solution.

Thanks.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

Hello,

 

Also with a new Table, i become this error.

 

MeAlfons_0-1664969351399.png

 

Attach you will find my dummy "Distance"PBIX file, with the same settings and relationship.

Sorry, i will find out now how to share this link.

 

MeAlfons_3-1664969860068.png

MeAlfons_4-1664969901361.png

 

In this file your code is working, but the outcome in my visual is still the sum of al values together.

 

MeAlfons_2-1664969569492.png

 

When i change this to "don't summarize" i become below error.

 

MeAlfons_1-1664969534729.png

 

 

Anonymous
Not applicable

Hi,

 

I hope this will work

 

https://1drv.ms/u/s!AtOPSsWoZPvOrU-GBG9Tt-eQvtuM?e=HjVxsz

 

 

Thank you.

 

Gr

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors