Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Dynamic Title

Hi,
I have a project I am working on and to visualise its effect I want to use Power BI. There are 8 activities in the project, and each of the activities' impact is measured in $ as well. resulting in 16 attributes in total. In one Power BI window I want to visualise only the activities themselves, not its impact measured in $, so only 8 of the 16 attributes. 

I have used this code as of now: 

Dynamic Title Summary =
IF(
    ISFILTERED('PBI Summary'[Projects]) || ISFILTERED('PBI Summary'[Attribute]),
    IF(
        DISTINCTCOUNT('PBI Summary'[Projects]) = 1 && NOT(ISFILTERED('PBI Summary'[Attribute])),
        SELECTEDVALUE('PBI Summary'[Projects], "All Ports") & ", All Activities",
        SELECTEDVALUE('PBI Summary'[Projects], "All Ports") & ", " &
        IF(
            DISTINCTCOUNT('PBI Summary'[Attribute]) > 1,
            CONCATENATEX(
                VALUES('PBI Summary'[Attribute]),
                'PBI Summary'[Attribute],
                ", ",
                'PBI Summary'[Attribute],
                ASC
            ),
            SELECTEDVALUE('PBI Summary'[Attribute], "Total Activities")
        )
    ),
    "All Ports, All Activities"
)


With this code, if I select for example Durban, T. Safety initatives and T. Activity, the title of the graph looks like this, exactly as I want it:


The problem, however, is when i have selected no location and no activity. Then the title looks like below, because I have filtered out the attributes in $:


I want the title to say "All Ports, All activities" when no location or activity is selected, but it seems like that does not happen because I have filtered some of the attributes out. 

I will add a link to a Google Drive file with a sample of the data as well: 
https://drive.google.com/file/d/1gGyFrGVD0ly6PEgHVEtugS7O5cfmke3R/view?usp=sharing

If anyone could provide some guidance for how I could achieve that, it would be greatly appreciated. Thanks! 

2 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks, I found a minor setting that made it not work for me 🙂 Works fine for me as well now!