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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Display data only of current month in a visual

Hi,

I have a clustered column chart, where I want to display data of only the current month. My data source is a SharePoint list. The data format is dd-mm-yyyy. I have created a new column with the formula:

IsCurrentMonth =
IF (
YEAR ( TableName[Date] ) = YEAR ( TODAY () )
&& MONTH ( TableName[Date] ) = MONTH ( TODAY () ),
"Yes",
"No"
)
But it is taking the date format as mm-dd-yyyy.
chart.JPG
So instead of June (6) it is picking up the 6th day.
I have also tried:
IsCurrentMonth =
VAR a= FORMAT(YEAR (TableName[Date]),"dd-mm-yyyy")
VAR b= FORMAT(YEAR ( TODAY () ),"dd-mm-yyyy")
VAR c= FORMAT(MONTH (TableName[Date]),"dd-mm-yyyy")
VAR d= FORMAT(MONTH ( TODAY () ),"dd-mm-yyyy")
return
If (a=b && c=d, "Yes", "No")
 
Still getting the same issue. 
Please help. Thanks in advance.
3 REPLIES 3
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

You can try this in a Calculated Column

 

CurrentMonth =
VAR a= YEAR (TableName[Date])
VAR b=YEAR ( TODAY () )
VAR c= MONTH (TableName[Date] )
VAR d=MONTH ( TODAY () )
return
If (a=b && c=d, "Yes", "No")

 

Regards,

Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Anonymous
Not applicable

@harshnathani Thanks for the reply, but still getting the same error. 😞

 

@Anonymous ,

 

Please share some sample data and the data type of the columns which are retrieved from Share Point.

 

Regards,

Harsh Nathani

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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