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
Shamatix
Post Partisan
Post Partisan

Missing rows when using SUM

Hi fellow users of Power Bi,

 

I have a table lets say it contains 3 colums A, B and C and has the Following Values

 

A  |B |C

Bo|1 |0

Bo|1 |0

Kik|2|3

-------

    |4|3

 

But today in power bi when I use a "SUM" it shows it as follows:

A  |B |C

Bo|2 |0

Kik|2|3

-------

    |4|3

 

I Know I can add a unique ID column to the table and that it will turn out correctly and show ALL the rows, but I find it to be an ugly solution. How can I have it shows the totals at the bottom AND all the rows, without making some "Hack solution" if you get me 🙂

Best regards

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @Shamatix , 

There is no method could achieve this directly. So one workaround is that you could show detail data in table and show total in Card like below

557.PNG

Best Regards,
Zoe Zhi

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

9 REPLIES 9
rajulshah
Super User
Super User

Hello @Shamatix,

I assume you're plotting 'B' column in the visualization. Please right click on the column in Fields Pane and click on "Don't summarize".
power-bi-aggregate-sum.png

If you use dont summarize I do not get the Total of the column at the bottom of the table which I want to have, but when I have "Sum" on, it hides some of the rows if I do not have a unique value..

@Shamatix,

 

Can you please share your expected results again? I am unable to understand you.

I hope this screenshot illustrates what I want and what it does now

https://i.imgur.com/Qmc1eBY.png

dax
Community Support
Community Support

Hi @Shamatix ,

I  think this is by design, if there is no unique id, it will show value as a group when you use aggregation or you will see all value but no total value. So I think current workaround is that you add an unique column before. 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUTJUitWBsIzArCQgywTMSoaLpUDUxQIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [name = _t, amount = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"name", type text}, {"amount", Int64.Type}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1)
in
    #"Added Index"

543.PNG

 By the way, you also could submit this  requirement in power-bi-ideas   

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Well the table it self has a unique ID, but I dont want the unique ID shown in the table im trying to show the end user as they have nothing to use the ID column for?

 

dax
Community Support
Community Support

Hi @Shamatix , 

There is no method could achieve this directly. So one workaround is that you could show detail data in table and show total in Card like below

557.PNG

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

What should Actually it display.

If you are looking for B =3

Try this

sumx(summarize(table,table[A],"_B",max(table[b])),[_B])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Well I want it to continue showing the total at the bottom of the table, so the total is correct.

My issue is that when you use a SUM on a column and the rows dont have a "Unique" value it hides some of the rows.

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.