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
paulj1
Helper II
Helper II

Summarize Column.... am i being to "Excel"... arghhhh

How do I add a pbix file to this post ?

 

So I have two data sources, one "Eaten", the other "Purchased".

 

PurchasedPurchasedEatenEaten 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Problem 1.... the two tables have common items, and both have unique items, so i want a consolidated table removong duplicates.. so i created a new table using...

SummarizeAllItems = union(SUMMARIZECOLUMNS(Eaten[Item]),
SUMMARIZECOLUMNS(Purchased[Item]))

This creates the table below, trouble is with duplicates......   So i created a second table...

 

Using this

 

NoDuplicates = SUMMARIZECOLUMNS(SummarizeAllItems[Item])

Added columns of;
Eaten = calculate(sum(Eaten[Eaten]),filter(Eaten,Eaten[Item]=NoDuplicates[Item]))
Purchased = calculate(sum(Purchased[Purchased]),filter(Purchased,Purchased[Item]=NoDuplicates[Item]))

SummarisedSummarisedNo Duplicates with SUMNo Duplicates with SUM

 

 

 

 

 

 

 

 

Doesnt seem very elegent, think i'm being to "Excel".....  how do i do this more elegantly....

 

Problem2........

 

When i then do a visual, the slicer doesnt work on location....... suspect its because ive done the first bit in a clunky way.... Help....

Output Table  Slicer doesnt workOutput Table Slicer doesnt work

 

 

 

 

1 ACCEPTED SOLUTION
samdthompson
Memorable Member
Memorable Member

Hi, in this situation i would use the powerquery end to tidy up the data. Three solutions here either a DAX table like you were trying or Merge or Append in power query:

 

DAX:

Joiny Table = UNION(SUMMARIZE(Purchased,Purchased[Item],Purchased[Location]),SUMMARIZE(Eaten,Eaten[Item],Eaten[Location]))

 

There are other solutions in DAX too with CROSSJOIN but in my opinion the above is the most straight foward.

 

Merge:

2018-05-24_9-41-59.png

 

Append:

2018-05-24_9-36-07.png

 

 

 

 

 

// If this is a solution please mark as such

// if this is a solution please mark as such. Kudos always appreciated.

View solution in original post

1 REPLY 1
samdthompson
Memorable Member
Memorable Member

Hi, in this situation i would use the powerquery end to tidy up the data. Three solutions here either a DAX table like you were trying or Merge or Append in power query:

 

DAX:

Joiny Table = UNION(SUMMARIZE(Purchased,Purchased[Item],Purchased[Location]),SUMMARIZE(Eaten,Eaten[Item],Eaten[Location]))

 

There are other solutions in DAX too with CROSSJOIN but in my opinion the above is the most straight foward.

 

Merge:

2018-05-24_9-41-59.png

 

Append:

2018-05-24_9-36-07.png

 

 

 

 

 

// If this is a solution please mark as such

// if this is a solution please mark as such. Kudos always appreciated.

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.