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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
sdhn
Responsive Resident
Responsive Resident

Getting one extra count.

Hello All,

 

I have a measure as

 

OpenNMSCounts = COUNTROWS(ALLSELECTED(Source)) -1
 
I am getting one extra count. 
For eg:
 
Totals Rows are "30" but its dispalys as: "31".  Any help will be appreciated.  Thanks 
10 REPLIES 10
sdhn
Responsive Resident
Responsive Resident

Getting error:

 

"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

Hi @sdhn 

 

Try to add a column from your table to the formula:

OpenNMSCounts = Distinct(ALLSELECTED(Source[Column])) 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

sdhn
Responsive Resident
Responsive Resident

It was my mistake. I rephrase my question. 

 

I have merged multiple files onto one file during transformation & load. New file is called Source.
Source. Name column has all files name. This column has created by load process. 
 
 
Below  measure is counting one extra row.  I want exact rows.

 

we are using following measure to get total counts of each types or files.

 

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

Hi @sdhn 

 

Try this:

Source =
CALCULATE (
    COUNTROWS ( VALUES ( Source[Source.Name] ) ),
    ALLEXCEPT ( Source, Source[Source.Name] )
)

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

sdhn
Responsive Resident
Responsive Resident

It change to 

 

count fo all files  only one row count as below:  

 

sdhn_0-1642033902218.png

 

With old code :

sdhn_1-1642034032806.png

 

 

@sdhn 

 

Can you post sample data as text and expected output? or the PBIX file?


The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables

Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/

sdhn
Responsive Resident
Responsive Resident

How to upload files. Thanks 

Upload to https://wetransfer.com/ and share thr link here

@sdhn 

VahidDM
Super User
Super User

Hi @sdhn 

 

Try this:

OpenNMSCounts = Distinct(ALLSELECTED(Source)) 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

sdhn
Responsive Resident
Responsive Resident

Did not work out.  Error 

 

screen grayed out 

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.