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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
dbrown2002
Regular Visitor

Auto identifying month

Morning,

 

I have a report that provides various HR info, one of the reports is regarding leavers, my data is stored and connected via excel and at the minute anything where I want to see only this month's figure I have to go in and manually input the month to change the figure it picks up from Excel.

dbrown2002_0-1701078497641.png

 

Is it possible to have this automatically done when I refresh the report, so it picks up what month we are in and updates the figure accordingly?

 

Thanks

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @dbrown2002 ,

 

Add a month colum in your data either in DAX or M and use that to filter your visuals. Sample DAX calc column:

Month =
FORMAT ( 'table'[date], "mmmm" )

The above column will return text strings and will be sorted alphabetically. Create another calc column to sort your month column by

Month Sort =
MONTH ( 'table'[date] )

Please refer to this link for custom column sort - https://radacad.com/sort-by-column-in-power-bi 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Calculates the current year and month in variables within the measure
VAR vYear= Year(Now())
VAR vMonth= Month(Now())
In the filter section, add the two respective conditions.

For a next one, copy the formula into the question description so you can easily replicate it. Don't use an image.

danextian
Super User
Super User

Hi @dbrown2002 ,

 

Add a month colum in your data either in DAX or M and use that to filter your visuals. Sample DAX calc column:

Month =
FORMAT ( 'table'[date], "mmmm" )

The above column will return text strings and will be sorted alphabetically. Create another calc column to sort your month column by

Month Sort =
MONTH ( 'table'[date] )

Please refer to this link for custom column sort - https://radacad.com/sort-by-column-in-power-bi 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

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.