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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
cuseman03
Helper I
Helper I

requesting help with duplicating row counts by counting # of rows * number of columns

Hi,

 

so i hope the solution is relatively easy for my problem.  My measure is overcouting rows.  So let's say I have a table with 10 columns and 1000 rows.  Well rather than return the 1000 cout for total rows, it's returning 10,000 because it's taking 1000 and multiplying it by each column.  It's doing this because my sql connection has a field called #ofrecords and it enters the amount of records in that table.  However, the query has a column called fields so again, it's counting total rows * every column.

 

Example

 

TableNameColumnNameNumberOfRecordsInTable
PurchaseOrdersSup Itm ID34,799,673
PurchaseOrdersSubmitter Name34,799,673
PurchaseOrdersSubmitter34,799,673
PurchaseOrdersSched Num34,799,673
PurchaseOrdersSales Tax34,799,673
PurchaseOrdersReceipt Status34,799,673
PurchaseOrdersReceipt Qty34,799,673
PurchaseOrdersReceipt Amount34,799,673
PurchaseOrdersRec dttm34,799,673
PurchaseOrdersProject34,799,673
PurchaseOrdersPO Vendor Name34,799,673
PurchaseOrdersPO Vendor34,799,673
PurchaseOrdersPO Status34,799,673
PurchaseOrdersPO Qty34,799,673
PurchaseOrdersPO Price34,799,673
PurchaseOrdersPO No34,799,673
PurchaseOrdersPO Dispatched Date34,799,673
PurchaseOrdersPO Date34,799,673
PurchaseOrdersPO BU34,799,673
PurchaseOrdersPO Amount34,799,673
PurchaseOrdersLine234,799,673
PurchaseOrdersLine34,799,673
PurchaseOrdersItem34,799,673
PurchaseOrdersFreight34,799,673
PurchaseOrdersExpected Receiving Date34,799,673
PurchaseOrdersDue34,799,673
PurchaseOrdersDistribution Status34,799,673
PurchaseOrdersCAP #34,799,673
PurchaseOrdersBRN - Budget Reference No34,799,673
PurchaseOrdersAsset Profile34,799,673
PurchaseOrdersAddress 334,799,673
PurchaseOrdersAddress 234,799,673
PurchaseOrdersAccount Type34,799,673
PurchaseOrdersAccount Descr34,799,673
PurchaseOrdersAccount34,799,673
PurchaseOrdersSt34,799,673
PurchaseOrdersShip To Name34,799,673
PurchaseOrdersShip To34,799,673
PurchaseOrdersRunSourceID34,799,673
PurchaseOrdersRequisition Status34,799,673
PurchaseOrdersRequisition Name34,799,673
PurchaseOrdersRequester Name34,799,673
PurchaseOrdersRequester34,799,673
PurchaseOrdersReq Vendor Name34,799,673
PurchaseOrdersReq Vendor34,799,673
PurchaseOrdersReq ID34,799,673
PurchaseOrdersReq Date34,799,673
PurchaseOrdersReq BU34,799,673
PurchaseOrdersReq Amount34,799,673
PurchaseOrdersPostal34,799,673
PurchaseOrdersKP Order Type34,799,673
PurchaseOrdersItem Description34,799,673
PurchaseOrdersGL Loc34,799,673
PurchaseOrdersFileDate34,799,673
PurchaseOrdersDept Name34,799,673
PurchaseOrdersDept34,799,673
PurchaseOrdersCntry34,799,673
PurchaseOrdersCity34,799,673
PurchaseOrdersCategory Description34,799,673
PurchaseOrdersCategory Code34,799,673
PurchaseOrdersAddress 134,799,673

 

what I need is the simply the '34,799,673' counted once.

 

Thanks,

2 REPLIES 2
Anonymous
Not applicable

HI @cuseman03 ,

In my opinion, I'd like to suggest you add more conditions to filter on the range of calculated column or try to use measure formula with filter conditions to instead column.

Calculated Columns and Measures in DAX 

Measure Totals, The Final Word 

In addition, can you please share more detail information about your scenario? I' m not so clear about your expression and calculation logic.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

parry2k
Super User
Super User

@cuseman03 try this measure

 

Total Rows = 
SUMX( 
VALUES ( Table[TableName] ), 
CALCULATE ( SUM ( Table[NumberofRecordsintable ) )
)

 



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.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.