The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I am using below expression:
It is not working for me. When I have value in M3_Gross_Sales_Contract_Entity.Value, it is showing % value.
I am also using below expression:
IIF(SUM(Fields!M3_Gross_Sales_Contract_Entity.Value) = 0 AND Fields!M3_Gross_Sales_Contract_Entity.Value="", 1,
(Sum(Fields!M4_Gross_Sales_Contract_Entity.Value, "Main")-SUM(Fields!M3_Gross_Sales_Contract_Entity.Value, "Main"))/SUM(Fields!M3_Gross_Sales_Contract_Entity.Value, "Main"))
when I have value in M3_Gross_Sales_Contract_Entity field, it is showing %value , but when there is no value in: M3_Gross_Sales_Contract_Entity, it is showing #error
Thanks,
Sandip
Solved! Go to Solution.
Hi, @sandipghosh2
You can use IIF statements or the IIf function in Paginated Reports to check for those conditions before performing the division. Here's an updated version of your expression:
=IIF(
SUM(Fields!M3_Gross_Sales_Contract_Entity.Value, "Main") = 0 OR IsNothing(Fields!M3_Gross_Sales_Contract_Entity.Value),
0, -- Or you can return a default value such as "N/A"
(SUM(Fields!M4_Gross_Sales_Contract_Entity.Value, "Main") - SUM(Fields!M3_Gross_Sales_Contract_Entity.Value, "Main")) / SUM(Fields!M3_Gross_Sales_Contract_Entity.Value, "Main")
)
Hi, @sandipghosh2
You can use IIF statements or the IIf function in Paginated Reports to check for those conditions before performing the division. Here's an updated version of your expression:
=IIF(
SUM(Fields!M3_Gross_Sales_Contract_Entity.Value, "Main") = 0 OR IsNothing(Fields!M3_Gross_Sales_Contract_Entity.Value),
0, -- Or you can return a default value such as "N/A"
(SUM(Fields!M4_Gross_Sales_Contract_Entity.Value, "Main") - SUM(Fields!M3_Gross_Sales_Contract_Entity.Value, "Main")) / SUM(Fields!M3_Gross_Sales_Contract_Entity.Value, "Main")
)