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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
SirD
New Member

Count all dates in the column that is less than or equal to the current month

Lets call the table name "Business Table", I need the DAX to create a measure that will count rows for each month and add it to the count of rows for the earlier months. 

 

Workshop  scheduled On 
01/10/2022
01/10/2022
01/11/2022
01/11/2022
01/11/2022
01/12/2022
01/12/2022
01/01/2023
01/01/2023
01/01/2023
01/01/2023
 

 

Expected Result should look like this

Oct-222
Nov-225
Dec-227
Jan-2311
1 ACCEPTED SOLUTION

Hi @SirD ,
Here is the measure:

Running Total = 

Var _currentDate = MAX(Workshops[Workshop Sceduled])

Var _calc = CALCULATE(Sum(Workshops[Count]),FILTER(ALL(Workshops),Workshops[Workshop Sceduled]<=_currentDate))

Return _calc


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Nathaniel_C
Community Champion
Community Champion

Hi @SirD ,

Like this?

Nathaniel_C_0-1673726281737.png


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @SirD ,
Here is the measure:

Running Total = 

Var _currentDate = MAX(Workshops[Workshop Sceduled])

Var _calc = CALCULATE(Sum(Workshops[Count]),FILTER(ALL(Workshops),Workshops[Workshop Sceduled]<=_currentDate))

Return _calc


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @SirD ,
First you will need to use Groupby in Power Query and count the number of dates in each month.

Go to the Transform tab, select GROUPBY, Count the rows and you will have the table in the picture. Then add the table to Power BI and run the measure.

 

 

 

Nathaniel_C_1-1673726732285.png


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




RemyO
Resolver I
Resolver I

Why not create a column MMM-yy

Then take that column and do a count(Workshop)

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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