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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors