Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have a basic table with a sales Id, Amount, Type activity. I want to create a new column in the table which will just return the Payments. So type = Payment, otherwise it will return a 0 for the other types. It should be based on id and the result set should look like below.
Id | Amount | Type | Payment AMount | |||||||
1 | 2 | Payment | 2 | |||||||
1 | 3 | Refun | 0 | |||||||
1 | 6 | Payment | 6 | |||||||
2 | 4 | Payment | 4 | |||||||
2 | 4 | Refund | 0 | |||||||
2 | 6 | Refund | 0 | |||||||
3 | 6 | Something | 0 | |||||||
3 | 4 | Refund | 0 | |||||||
3 | 1 | Payment | 1 | |||||||
4 | 1 | Payment | 1 | |||||||
4 | 2 | Something | 0 | |||||||
4 | 5 | Something | 0 | |||||||
4 | 10 | Payment | 10 |
Solved! Go to Solution.
Hi @newkingdom
You can create a calculated column in this case:
Payment Amount = IF(
TableName[Type] = "Payment",
TableName[Amount], 0)
I just tested this on my data and it worked. If the data-type of Amount is Number use 0, otherwise use "0"
If you think my solution worked , please 'Accept' it as a solution and give it a like.
Thanks,
Mahesh
Hi @newkingdom
You can create a calculated column in this case:
Payment Amount = IF(
TableName[Type] = "Payment",
TableName[Amount], 0)
I just tested this on my data and it worked. If the data-type of Amount is Number use 0, otherwise use "0"
If you think my solution worked , please 'Accept' it as a solution and give it a like.
Thanks,
Mahesh
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
Hi @newkingdom ,
Try this:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
119 | |
78 | |
58 | |
52 | |
48 |
User | Count |
---|---|
171 | |
117 | |
61 | |
59 | |
53 |