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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Timothyg
New Member

If description is blank, use other description.

Hi all

 

I need assistance with a report on Power BI report builder.

I have a code and description but if that description is blank, it must use a different fields description.

I have the below code that works on the code & description but if the description is blank, it must use the function description instead with the code. Some of the codes have descriptions but for the codes with no description, it must pull from the function description.

=IIF(IsNOTHING(Fields!Code.Value), " ", IIF(Parameters!SHOWCODE.Value = True, Fields!Code.Value + " - " + Fields!Description.Value, Fields!Description.Value))

I hope someone will be able to assist me in the right direction.

1 ACCEPTED SOLUTION
Bibiano_Geraldo
Super User
Super User

HI @Timothyg ,

Try to modify your expression using this, and let me know if worked:

=IIF(IsNothing(Fields!Code.Value), " ", 
    IIF(Parameters!SHOWCODE.Value = True, 
        Fields!Code.Value + " - " + 
        IIF(IsNothing(Fields!Description.Value) OR Fields!Description.Value = "", Fields!FunctionDescription.Value, Fields!Description.Value), 
        IIF(IsNothing(Fields!Description.Value) OR Fields!Description.Value = "", Fields!FunctionDescription.Value, Fields!Description.Value)
    )
)

 

If this help you, please consider to mark it as solution and give a kudo.

 

Thank you

I hope this helps! 
If you found this answer helpful:
✔️ Mark it as the solution to help others find it faster.
 Give it a like to show your appreciation!

Thank you for contributing to our amazing Power BI community! 

View solution in original post

2 REPLIES 2
Bibiano_Geraldo
Super User
Super User

HI @Timothyg ,

Try to modify your expression using this, and let me know if worked:

=IIF(IsNothing(Fields!Code.Value), " ", 
    IIF(Parameters!SHOWCODE.Value = True, 
        Fields!Code.Value + " - " + 
        IIF(IsNothing(Fields!Description.Value) OR Fields!Description.Value = "", Fields!FunctionDescription.Value, Fields!Description.Value), 
        IIF(IsNothing(Fields!Description.Value) OR Fields!Description.Value = "", Fields!FunctionDescription.Value, Fields!Description.Value)
    )
)

 

If this help you, please consider to mark it as solution and give a kudo.

 

Thank you

I hope this helps! 
If you found this answer helpful:
✔️ Mark it as the solution to help others find it faster.
 Give it a like to show your appreciation!

Thank you for contributing to our amazing Power BI community! 
rajendraongole1
Super User
Super User

Hi @Timothyg - you can adjust your expression to add this fallback logic.

 

=IIF(IsNothing(Fields!Code.Value),
" ",
IIF(Parameters!SHOWCODE.Value = True,
Fields!Code.Value & " - " &
IIF(IsNothing(Fields!Description.Value) OR Trim(Fields!Description.Value) = "", Fields!FunctionDescription.Value, Fields!Description.Value),
IIF(IsNothing(Fields!Description.Value) OR Trim(Fields!Description.Value) = "", Fields!FunctionDescription.Value, Fields!Description.Value)
)
)

 

Function Description when Description is blank, displaying the Code only when SHOWCODE is set to True

Hope this helps.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.