Forum Discussion

dbrown2002's avatar
dbrown2002
Regular Visitor
2 years ago
Solved

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.

 

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

  • 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 

2 Replies

  • 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 

  • 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.