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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Bharathi_99
Helper IV
Helper IV

Dynamic Month name for selected month

Hi all,

I am trying to get dynamic previous month name for the selected month in the date picker

I am using Field Parameters to achieve this

previous month =
    {
    (
       FORMAT(DATE(YEAR(MAX('Fact Content'[date])), MONTH(MAX('Fact Content'[date])) - 0, 1), "MMMM"),NAMEOF('Fact Content'[Previous Month]),0


    ),
    (
        FORMAT(DATE(YEAR(MAX('Fact'[date])), MONTH(MAX('Fact'[date])) - 1, 1), "MMMMDD-YYYY"),
        NAMEOF('Fact'[Before Prev Month]),
        -1
    )
}


I am using above script to get the previous month name
when I am using this same in a measure ait's working but not with field parameters

Can anyone please help
I tried many ways but nothing worked
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Bharathi_99 ,

 

Format( eomonth( Max( Fact[date]), -1), "MMMM")

 

in case you want the default slicer on last month

 

You need a column like

Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" , //Last Month
eomonth([Date],0)= eomonth(Today(),0),"This Month" , //This Month
[Month Year]
)

 

Save on Last month

 

For measure you can use TI

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,

 

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Bharathi_99 ,

 

Format( eomonth( Max( Fact[date]), -1), "MMMM")

 

in case you want the default slicer on last month

 

You need a column like

Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" , //Last Month
eomonth([Date],0)= eomonth(Today(),0),"This Month" , //This Month
[Month Year]
)

 

Save on Last month

 

For measure you can use TI

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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