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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
srisiva55
Frequent Visitor

Business Requirement to calculate metric calculation for certain category row by row basis

Hi All, I had requirement that states if product name like 'Jacket %' Or Product name like 'Shirt%' then expected value =Product Cost/1000 Other wise keep value as it is for rest of product names. How to do this in Query Edictor by adding new calculated column. Please help.  So below Product Names especially for Jacket, Shirt appended with some other text so I need to choose Like operation only  for example : Product Name LIKE 'Jacket%' etc..

 

 

 

Requirement.jpg

 

1 ACCEPTED SOLUTION
MS_Sum
Frequent Visitor

Hi @srisiva55 

1. Add a Calculated Column and use the formula mentioned below and see if it works. Change the column values as per your table

Expected Value =
IF(
    OR(
           LEFT([Prod Name], 6) = "Jacket",
        LEFT([Prod Name], 5) = "Shirt"
    ),
    DIVIDE([Prod Cost], 1000),
    [Prod Cost]
)
MS_Sum_0-1682148813929.png

If the suggestion helps, give a kudo and mark my reply as a solution  🙂

View solution in original post

1 REPLY 1
MS_Sum
Frequent Visitor

Hi @srisiva55 

1. Add a Calculated Column and use the formula mentioned below and see if it works. Change the column values as per your table

Expected Value =
IF(
    OR(
           LEFT([Prod Name], 6) = "Jacket",
        LEFT([Prod Name], 5) = "Shirt"
    ),
    DIVIDE([Prod Cost], 1000),
    [Prod Cost]
)
MS_Sum_0-1682148813929.png

If the suggestion helps, give a kudo and mark my reply as a solution  🙂

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors