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
AlejoRivera
Regular Visitor

obtaining a result based on a conditional sum in the same column

Hello community, I need help to obtain a result based on a conditional SUM in the same column. I don't which is the easiest way, creating  "custom column" or a measure.  

 

I've the following table, 

 

| DOCUMENT# | PRODUCT_STEP |

| 1234            |      1                       |
| 1234            |      4                       |

| 1234            |      8                       | 
 
What I want to create is a new column or measure to obtain a new result:  

If "Document#" SUMS "5" then, "Product X", Otherwise, Product_step.

RESULT: 

 

| DOCUMENT# | PRODUCT_STEP |  PRODUCT TYPE  

| 1234            |      1                      |    Product X         
| 1234            |      4                      |    Product X          

| 1234            |      8                      |    8                        

The "document#" are mostly uniques but each of one of them can pass trough 2 or 3 "Product_steps", not that often but it can,  and if it does, then it becomes in a diff type of product, which is what I need to identify creating a new column or measure.

 

I know that with this formula I'll have duplicates, but I cansimply divide the total outcome in 2 to have the exact number. Or if you can suggest a better way to do it, I'm all ears (eyes)

Important note: My tables are from a server, thus, I can't edit the structure that much. 

Thanks a lot!!

1 REPLY 1
v-yulgu-msft
Employee
Employee

Hi @AlejoRivera,

 

In this scenario, you should create custom column to get the desired result. As in a measure, it is not possible to compare each item (DOCUMENT#) of one column with a specific value (Sums) insde IF function and return multiple values that can generate a column. The expected logic only applies to calculated column.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.