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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Vindy
Regular Visitor

if statement in Measure

In red is a measured column which is 

% Scrap = ([Q4QTY minus Q4QTY 2]/[Production plus scrap])
How do I make %Scrap say PURCHASED if the purchased Parts = 2 and Qty Good Production is blank?

 

Vindy_0-1631909501241.png

 

1 ACCEPTED SOLUTION
mussaenda
Super User
Super User

Hi @Vindy ,

 

if you are willing  to convert your %Scrap to text,

Please try and substitute with your columnnames

VAR _Scrap% = 
( your % Scrap calculation ) * 100

RETURN

IF(
Purchased Parts = 2 && Qty Good Production = BLANK (),
"PURCHASED",

IF(
Purchased Parts = 1 && Qty Good Production = BLANK (),
_Scrap% & "%",

_Scrap% & "%"


 

View solution in original post

1 REPLY 1
mussaenda
Super User
Super User

Hi @Vindy ,

 

if you are willing  to convert your %Scrap to text,

Please try and substitute with your columnnames

VAR _Scrap% = 
( your % Scrap calculation ) * 100

RETURN

IF(
Purchased Parts = 2 && Qty Good Production = BLANK (),
"PURCHASED",

IF(
Purchased Parts = 1 && Qty Good Production = BLANK (),
_Scrap% & "%",

_Scrap% & "%"


 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.