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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
sdhn
Responsive Resident
Responsive Resident

Merge Tables & Counts

Hello All,

 

I have 5 source files on same folder.

I used Get Data -- Folder options to merge all files onto one file called Source. 

 

I need to counts rows for each file.

 

 Following measure counts all rows togather  (Count all 5 files rows):

Source Counts  = COUNTROWS(ALLSELECTED('Source'))-1
 
I want to counts rows for each file.
 
OMP
40
 
ABC
8
 
XYZ
10
 
AEIOU
22
 
I have follwing sample columns
 
Source.NameServiceEsclation TeamCreatedOwner
OMPTelephonetest01/01/2022AB
ABC911test112/01/2021CD
XYZ211FF01/02/2022YZ
AEIOU007Pol12/31/2021UV

 

 help will be appreciated.  Thanks 

1 ACCEPTED SOLUTION

@sdhn  if i have a table like this

smpa01_0-1641403063180.png

 

The above measure gives me this

smpa01_1-1641403140659.png

 

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

6 REPLIES 6
smpa01
Super User
Super User

@sdhn  try this

measure = CALCULATE(COUNT(tbl[Source.Name]),ALLEXCEPT(tbl,tbl[Source.Name]))
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
sdhn
Responsive Resident
Responsive Resident

measure = CALCULATE(COUNT(tbl[Source.Name]),ALLEXCEPT(tbl,tbl[Source.Name]))

 

Source.Name is the column name. It is giving me a total row counts of all files. I want each file separately.   Thanks 

@sdhn  if i have a table like this

smpa01_0-1641403063180.png

 

The above measure gives me this

smpa01_1-1641403140659.png

 

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
sdhn
Responsive Resident
Responsive Resident

Actuall I got it. I need to click new measue and source.name.  Thank You 

 

sdhn_0-1641403720312.png

 

sdhn_1-1641403738456.png

 

sdhn
Responsive Resident
Responsive Resident

Source.Name column has been created when I merged (transform & load)  files onto one file. Probably becasue of this.  This column was not a part of a files ealier.  Under the source.name col. I have all 5 files names listed with extension.   any thoughts

@sdhn  provide a sample pbix, hard to guess from words.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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