Forum Discussion

sdhn's avatar
sdhn
Responsive Resident
4 years ago

Title Change

Hello All,

 

I am using Power Bi desktop to create reports.

For title of report I am using following code:

 

Title =
VAR __selected = ALLSELECTED( MailPackage[MONTHS] )
RETURN
IF(
COUNTROWS( __selected ) = 12,
"Yearly Analysis",
"Monthly Packages of " & UNICHAR( 10 )
& CONCATENATEX( __selected, MailPackage[MONTHS], " , " & UNICHAR( 10 ) )
)
 
It dispays in title as: 

Monthly Mail Volume Fiscal Year 2021-2022

Monthly Packages of Feb, Mar, Apr, May 
 
I want to disaply only title as: 

"Monthly Mail Volume Fiscal Year 2021-2022"

 

Any help will be appreciated.

 

Thanks 

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi sdhn 

    I think the logic of your code is to return different titles based on counting of month you select in slicer, if you select all 12 months, title will return "Yearly Analysis", if you select part of them, title will return "Monthly Packages of...,...,... .

    I couldn't find "Monthly Mail Volume Fiscal Year 2021-2022" in your code. If you only want to get a defined title, you can change your code to return a text :Monthly Mail Volume Fiscal Year 2021-2022, or change your title directly.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.