Forum Discussion

gdexter's avatar
gdexter
Frequent Visitor
8 years ago
Solved

Dynamic text based on Month Name IMPOSSIBLE?

Power BI Community,

 

Reaching out for help!

 

I want to create a dynamic text that changes based on the filtered selection. I have been attempting to use if and iscrossfiltered in DAX. I don't know what to write in order to output the actual name of the month. Below is my attempt:

 

 

The "DAILY DATES" column above is just a list of all the days in 2017. I have a slicer that allows me filter them on month-month basis.

 

 

Thanks,

Gdextor

 

 

 

 

 

  • Anonymous

     

    Problem Solved...

     

     

    The "-1" in the current month line had to be changed to a "0".

     

    Many thanks,

    Gdexter

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Try this

     

    Measure =
    IF (
        ISFILTERED ( 'DAILY DATEs'[Daily] ),
        "Looking at payment data between " & [SELECTED MONTH - 1]
            & [SELECTED MONTH],
        "Please Select a month"
    )

    If that doesnt work try the second one

     

     

     

    Measure =
    IF (
        ISFILTERED ( 'DAILY DATEs'[Daily] ),
        "Looking at payment data between "
            & FORMAT ( EOMONTH ( MIN ( 'DAILY DATEs'[Daily] ), -1 ), "MMMM YYYY" )
            & FORMAT ( EOMONTH ( MAX ( 'DAILY DATEs'[Daily] ), -1 ), "MMMM YYYY" ),
        "Please Select a month"
    )

     

    • gdexter's avatar
      gdexter
      Frequent Visitor

      Hi Anonymous,

       

      Thanks for the solution. The second formual worked form (I had to change isfiltered to iscrossfiltered) but instead of showing the selected month and the month before the selected month, the month before the selected month is shown twice. I have attached image below.

       

      Can you suggest a fix for this?

       

      Also including the actual formula I used, in case you wish to confirm.

       

      Many thanks,

      Gdexter

      • gdexter's avatar
        gdexter
        Frequent Visitor

        Anonymous

         

        Problem Solved...

         

         

        The "-1" in the current month line had to be changed to a "0".

         

        Many thanks,

        Gdexter