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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

How do we show TOTAL number of rows in a table based on created date

I am completely a newbie to powerBI. I have a simple table with a "ID" and "CREATED_ON" fields.

I want to create a visualization that shows, the total number of rows in the table based on the "CREATED_ON" field.

The COUNTROWS(TABLE) Displays the records that were created on that particular date. but it does not show the total records including previous dates as well.

 

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Try this approach:

  1. Create a Calendar Table and build a relationship from the CREATED_ON field of your base data table to the Date column of your Calendar Table
  2. To your slicer, drag Date from the Calendar Table and select any one date there
  3. Write these measures

Measure1 = COUNTROWS(TABLE)

Measure1 running total = CALCULATE([Measure1],DATESBETWEEN(Calendar[Date],MINX(ALL(Calendar),Calendar[Date]),MAX(Calendar[Date])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

What type of count you mean? The current 'create on' fields row count or the cumulative row count that less than or equal to the current row?
If you mean the current row count, you can create a table visual with two 'create on' fields, one used as category and setting to 'do not summary' the other use aggregate mode 'count'.
If you mean cumulative row count, you can create a measure formula with AlB's formula.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
AlB
Community Champion
Community Champion

Hi @Anonymous 

If you want to show for each date the number of rows in the table with that or or a previous date, you can:

1. Place Created on in the rows of a matrix visual

2. Place this measure in the matric visual 

Measure =
CALCULATE (
    COUNT ( Table1[Created_On] ),
    FILTER (
        ALL ( Table1[Created_On] ),
        Table1[Created_On] <= MAX ( Table1[Created_On] )
    )
)

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

 Cheers 

SU18_powerbi_badge

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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