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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
BrentHamm
New Member

Creating a Summary table from two fact tables

I am struggling with the dax to create a summary table (in red box) from a purchase and invoice table as shown below.

 

The data needs to be in this format for the venn digram to function.  I also need the slicer to function.

 

Basically am looking to see what accounts have invoices but no purchases, and the other way around.  If an account has multiple purchases or invoices, it does not matter, still only counted as 1.

 

I have attached the PBIX, and honestly have spent more time on this than i care to admit!

 

PBIX Here 

 

BrentHamm_0-1609265490834.png

 

Thanks!

 

1 ACCEPTED SOLUTION
StefanoGrimaldi
Resident Rockstar
Resident Rockstar

try something like this:

StefanoGrimaldi_0-1609267573830.png

summary table = SUMMARIZE(Accounts,Accounts[ID],"HasInvoice",IF(CALCULATE(COUNT(Invoices[Invoice ID]))>0,1,0),"haspurchase",IF((CALCULATE(COUNT(Purchases[Purchase ID])))>0,1,0))
then add a column as follow for the counter on the new table: 
counter = if(and(summary table[ hasinvoice]=1,summary table[haspurchase]=1),1,0)
 
if this helped solve your question please masrk as solution, and if if like the solution give kudos 🙂 




Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
BrentHamm
New Member

l the Venn Diagram i used there is very specific on the format of data it needs.  Not sure how i could make it draw from the the other tables with out having a summary.

parry2k
Super User
Super User

@BrentHamm I'm not sure why you think you cannot achieve without creating a summary table. Anyhow, you already have a solution, if you are ok with it, you are good. You always want to think about how any solution will scale and perform when you are working with a large dataset. Good luck.!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@BrentHamm what is a counter? You don't need to create an extra summary table to achieve this, the recommendation would be to create measure without adding extra table in the model.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

The Venn diagram i am using is very specific requirements.  I see no way to make it work with out an extra table.

 

However, would love a solution that did not need it.

StefanoGrimaldi
Resident Rockstar
Resident Rockstar

try something like this:

StefanoGrimaldi_0-1609267573830.png

summary table = SUMMARIZE(Accounts,Accounts[ID],"HasInvoice",IF(CALCULATE(COUNT(Invoices[Invoice ID]))>0,1,0),"haspurchase",IF((CALCULATE(COUNT(Purchases[Purchase ID])))>0,1,0))
then add a column as follow for the counter on the new table: 
counter = if(and(summary table[ hasinvoice]=1,summary table[haspurchase]=1),1,0)
 
if this helped solve your question please masrk as solution, and if if like the solution give kudos 🙂 




Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




That is exactly what i wanted, and i was close.  Thanks so much!!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.