cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Super User

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!

5 REPLIES 5
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
Helper IV

Tks Tahreem24,

but the tables structure are not the same.

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

tks for all!

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?

Super User

@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!

Super User

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!

Announcements