Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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.
Solved! Go to Solution.
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
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
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.
Proud to be a Super User! | |
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
91 | |
87 | |
84 | |
66 | |
49 |
User | Count |
---|---|
131 | |
110 | |
96 | |
70 | |
67 |