March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello, how to get the number of rows as the total value in a table visual since the data is from multiple tables? Appreciate any help!
Thank you
Hi,
It will depend upon the fields that you have dragged to the visual. Share the download link of the PBI file and show the expected result.
Hi @Elichka ,
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please feel free to let me know.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can count whatever the primary key on the table is. Like if you have a table that shows customer ID, customer name, order quantity and sales amount, coming from 2+ tables, you would count the customer ID row as that would be what is making the rows unique.
It's kind of hard to get it to show up in a table visual in a way that is visually appealing, because any row count is just going to return 1 on each row before you get to the total at the bottom... sometimes I'll turn off the alternating row color and set the font to white to match the background on the values for that column to make it look slightly less lame... the total will still show in the normal font color.
RowCount = COUNTROWS('YourTableName')
Replace 'YourTableName' with the name of the table you want to count the rows for. You can find the table name in the Power BI Fields pane.
Press Enter to create the measure.
Once you've created the measure, you can add it to your table visual. Simply drag and drop the "RowCount" measure from the Fields pane onto the Values or Columns area of the table visual.
This measure will display the total count of rows for the table visual you specified. When you add it to your table visual, you'll see the count displayed as a single value in your table.
If your data is coming from multiple tables, you should create separate measures for each table that you want to count, following the same steps. This way, you can have individual row counts for each table in your report.
OR
Assuming you have two tables, Table1 and Table2, and you want to count the rows in both of them:
TotalRowCount = COUNTROWS(Table1) + COUNTROWS(Table2)
You can expand this pattern to include additional tables by adding more COUNTROWS functions and summing them up.
Go to the "Modeling" tab in the Power BI ribbon.
In the "Calculations" group, click on "New Measure."
In the formula bar, enter the DAX measure formula as shown above, taking into account all the tables you want to count.
Press Enter to create the measure.
Once you've created the measure, you can add it to your table visual by dragging and dropping the "TotalRowCount" measure onto the Values or Columns area of the table visual.
This measure will display the total count of rows from all the specified tables in your table visual.
Remember to adjust the DAX measure based on the actual table names and the number of tables you want to count rows for in your report.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
86 | |
77 | |
57 | |
52 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |