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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
JohanKnape
Regular Visitor

Total count that month

I'm trying to get a total count of all the rows and show the increase or decline each month. Tried some of the examples here with running totals etc but can't make it work.

 

I don't have a sum, but it's the amount of total rows that have a date greater than the last month I want to show.

 

So I have 100k rows. With a date, a guid, productgroup, name etc.

 

So I want to show the following in a graph

2016-01 -- 100k rows

2016-02 -- 99k rows

2016-03 -- 98k rows

2016-04 -- 99k rows

etc etc.

 

Anyone got any suggestions? And have I explained properly or do you need more info?

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @JohanKnape,

 

According to your description, you want to get the rows count of current month, right?

 

If this is a case, you can try to use below formula if it suitable for your requirement.

 

Measures:

 

Count Of Current Month = 
var currDate=MAX([Date])
Return
COUNTX(FILTER(ALL('Date Table'),YEAR([Date])=YEAR(currDate)&&MONTH([Date])=MONTH(currDate)),[Date])


Count Of Previous Month = 
var currDate=MAX([Date])
Return
COUNTX(FILTER(ALL('Date Table'),[Date]>=DATE(YEAR(currDate),MONTH(currDate)-1,1)&&[Date]<=DATE(YEAR(currDate),MONTH(currDate),1)-1),[Date])

Increase=[Count Of Current Month] - [Count Of Previous Month]

 

Regards,

Xiaoxin Sheng

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

Hi, did a fast try of your examples but didn't get it to work.

Will try again this afternoon when I have more time and hopefully get it right.

 

 

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors