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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
jr3151006
Helper IV
Helper IV

How to count (sum) records from different Tables?

Hi,

 

we have a situation with an Excel file which has 03 spreadsheets inside. When we open it via PBI, we select all of these 03. The

We need show on some page, the count of all records from spreadsheet A + all records from spreadsheet B + all records from spreadsheet C.

 

Let's say that the:

  • 'A' has 02 records;
  • 'B' has 04 records;
  • 'C' has 05 records.

 

So, we need show that the results of this sum is '11'.

 

>>> How to accomplish that?

1 ACCEPTED SOLUTION
TheoC
Super User
Super User

Hi @jr3151006 

 

You can use something like the following:

 

Measure = 

VAR _1 = COUNTROWS ( 'TableA' )
VAR _2 = COUNTROWS ( 'TableB' )
VAR _3 = COUNTROWS ( 'TableC' )

RETURN
_1 + _2 + _3

 

Hope this helps 🙂

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

5 REPLIES 5
Tahreem24
Super User
Super User

@jr3151006 If all those 3 sheets have same structure so combine them by creating a new table using UNION function.

New Table = UNION(Sheet1,Sheet2,Sheet3)

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Tks Tahreem24,

 

but the tables structure are not the same.

 

I was able to test with success the 'Teoc' advice.

 

tks for all!

jr3151006
Helper IV
Helper IV

Ok, tks, I'll try it in a few hours.

 

Another 'basic' question, if the end user (how has obtained access via share) change some filter, that new measure will respect the filter applied or it will be fixed? 

@jr3151006 ,it will respect the filters in the current state.

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

TheoC
Super User
Super User

Hi @jr3151006 

 

You can use something like the following:

 

Measure = 

VAR _1 = COUNTROWS ( 'TableA' )
VAR _2 = COUNTROWS ( 'TableB' )
VAR _3 = COUNTROWS ( 'TableC' )

RETURN
_1 + _2 + _3

 

Hope this helps 🙂

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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