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
TijmenVlug
Frequent Visitor

Rowcount in card not matching rowcount in table

Hi Guys,

 

Im wokring on a report where im showing all inoices that have a revenue equal to 0 for the last week. This give me a table with 66 rows of orders (can be the same order multiple times if multiple orderlins are equal to 0.

 

This report is automaticlally sent out to management weekly and managament wants to be able to see the amount of rows we are talking about in a card.

 

However if i add the card with a count of orders with revenue equal to 0 i get way more orders, around a thousand...

 

TijmenVlug_0-1734357344777.png

In this screenshot you can see that the amount of rows in the table can never be 985 (look at size of scrollbar). I exported the table and got 66 rows back.

 

How am i able to match the rowcount in the card with the rowcount of the table?

3 REPLIES 3
Anonymous
Not applicable

Hi @TijmenVlug ,

 

If you want to filter the data with revenue of 0 in the card visual object, then you need to drag the field into the visual object pane on the right hand side, like shown in the image below:

vkaiyuemsft_0-1734421595927.png

 

The final result is shown in the image below and more details can be found in the attachment.

vkaiyuemsft_1-1734421622439.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

SacheeTh
Resolver II
Resolver II

Try using the following Dax for the card, The mismatch between the row count in your card and the table in Power BI is likely caused by the aggregation behavior or data model relationships. Here's how you can troubleshoot and fix the issue:

Possible Reasons and Fixes

  1. Ensure the Measure Logic Matches the Table Filter Context:

    • The card is likely calculating the count using a different filter context than your table.
    • If your table shows 66 rows, it uses a specific filter context. You need to ensure the measure in the card respects the same context. Use the following DAX formula to count rows in the same context:
      Measure = COUNTROWS(VALUES(TableName[OrderID]))
    • Replace TableName[OrderID] with the appropriate column in your table that represents unique rows (e.g., OrderID).
  2. Avoid Counting Unique Orders if Duplicate Lines Exist:

    • If your table includes multiple lines for the same order, COUNT or DISTINCTCOUNT in your card may count those duplicates separately.
    • To align the card count with the table, use:
      Measure = COUNTROWS(FILTER(TableName, TableName[Revenue] = 0))
  3. Check Relationships in Your Data Model:

    • If your report uses data from multiple tables, ensure relationships between the tables are properly set up and filters are flowing correctly.
    • Use Manage Relationships in Power BI to confirm the relationships are active and correctly configured.
  4. Export to Verify Data Consistency:

    • Since you exported the table and got 66 rows, check if there are any filters in the table visual that are not applied to the card measure.
  5. Force the Same Filters Using ALLSELECTED:

    • To ensure the card respects the same filters as the table, modify your DAX measure to include ALLSELECTED:
      Measure = COUNTROWS(ALLSELECTED(TableName))
    • This ensures that the card reflects the rows visible in the table visual.
  6. Check for Hidden Filters in the Card:

    • Check if your card is being affected by a slicer or filter that is not applied to the table.
  7. Card Calculation Debugging:

    • Create a temporary table visual with the same logic as the card measure to verify whether it's calculating correctly:
      CALCULATETABLE(
          VALUES(TableName[OrderID]),
          TableName[Revenue] = 0
      )

Step-by-Step Solution

  1. Recheck the DAX formula used for your card.
  2. Align the filters in your card measure with the table.
  3. Test the COUNTROWS measure in a table visual to validate the calculation.
  4. Adjust the relationships if data is coming from multiple tables.

If the issue persists, share the DAX formula for your card and the data structure for further guidance.

Bibiano_Geraldo
Super User
Super User

Hi @TijmenVlug , 

Please share with us the DAX that you're using for you measure to count rows.

 

 

Helpful resources

Announcements
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.