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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
abcdefghij
Regular Visitor

sum of # to display in current month

How do i get the calculate sum formula to only display the sum into the currently month instead of all the months as shown? Example 56 should only be shown for current month row (Jan 2024) not all months. Thanks!

 

abcdefghij_1-1706127133995.png

 

 

3 REPLIES 3
Daniel29195
Super User
Super User

@abcdefghij 

 

write this code : 

new column  = 

var month  =  month ( today())

var year      =  year(today() ) 

 

var calc = 

sumx(

filter (

all ( tbl_name[ values.1] , tbl_name[curernt .. cdc] ) , 

year (tbl_name[ values.1])  = year      && month ( tbl_name[ values.1] ) = month  

)

var current_row_month = month(tbl_name[ values.1])

var current_row_year = year(tbl_name[ values.1])

 

return 

switch(

true() , 

current_row_month = month &&  current_row_year  = year       , calc  ) 

 

 

let me know if it works out for you . 

 

 

If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. I would appreciate hitting that kudos 👍🫡

 

@abcdefghij 

NB : need to convert values.1 column to date if it is text 

ryan_mayu
Super User
Super User

@abcdefghij 

you can try to create a column

 

current month = if('Table'[date]>EOMONTH(today(),-1) && 'Table'[date]<EOMONTH(today(),0), "Y")
 
then sum the column value = "Y"
 
11.PNG22.PNG
 
or create a column
 
Column = sumx(FILTER('Table','Table'[date]>EOMONTH(today(),-1) && 'Table'[date]<EOMONTH(today(),0)),'Table'[value])
 
 

11.PNG

 

pls see the attachment below





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

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

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

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.