Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Dynamic column name using Field Parameters

Hi all,

I have created table chart to show Views for Content 'News', 'Series' and 'Movies'
In that I have shown Current month views and Previous month Views for those 3 above contents 
I have also shown avg month to month views percentage also 
So here my query is it must show the current month name for whatever month I selected from date slicer
I I select May 2022, it must show May 2022 As column header in place of Current Month 
and same for Previous month it must show the Previous month name for whatever month I selected from date slicer
If I select May 2022 it must show April 2022 as Column header in place of Before prev month

I tried to create using Field Parameters option that is there in PBI
But it's showing static names just showing Current month and previous month name if I select any date also
It's not changing dynamically

Month Name =
    {
    (
        FORMAT(DATE(YEAR(MAX('Fact Content'[date])), MONTH(MAX('Fact Content'[date])) , 1), "MMMMDD-YYYY"),
        NAMEOF('Fact Content'[Previous Month]),
        0
    ),
    (
        FORMAT(DATE(YEAR(MAX('Fact Content'[date])), MONTH(MAX('Fact Content'[date])) - 1, 1), "MMMMDD-YYYY"),
        NAMEOF('Fact Content'[Before Prev Month]),
        -1
    )
}

I have useed above script
But not getting output in correct way


Please help
Thanks in advance

1 Reply