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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
btalahmbong
Advocate II
Advocate II

Count Text Values by Specific Date

Is it possible to count a set of rows for a set of dates, then show that sum on a visual as the total on the last date(only last date showed) ?
For Example;

We have a table with 2 columns Date and Title:

DATE                    TITLE

1/1/2016              Charles Dickens

1/2/2017              William Shakespeare

1/3/2017              Numen Georges

 

I want to be able to have a visual that returns the sum as follows;

DATE                   SALES

1/3/2017             3

 

So in a bar chart or waterfall chart, I'll have a single bar with only one date and the sum of the counted rows up to that date. 

 

Thanks for the help!

1 ACCEPTED SOLUTION
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @btalahmbong,

I reproduce your scenario using the sample data. Create two measures using the fomulas.

The last day = CALCULATE(MAX(Test[DATE]),ALL(Test))
SALES = CALCULATE(COUNTA(Test[TITLE]),FILTER(Test,Test[DATE]<=Test[The last day]))


Create a table visual, select two measures as value level, you will get the expected result as follows.

2.PNG

Thanks,
Angelia


View solution in original post

2 REPLIES 2
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @btalahmbong,

I reproduce your scenario using the sample data. Create two measures using the fomulas.

The last day = CALCULATE(MAX(Test[DATE]),ALL(Test))
SALES = CALCULATE(COUNTA(Test[TITLE]),FILTER(Test,Test[DATE]<=Test[The last day]))


Create a table visual, select two measures as value level, you will get the expected result as follows.

2.PNG

Thanks,
Angelia


Greg_Deckler
Community Champion
Community Champion

Create a couple measures like:

 

MaxDate = MAX(Table[DATE])
Total Count = RETURN CALCULATE(COUNTA(Table[TITLE]),FILTER(Table[DATE]<=[MaxDate]))

Then put Total Count in a Bar Chart and put a Card visual under it with MaxDate. That's the easiest way.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors