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
rorand
Helper I
Helper I

Subtract value only if value in other colum

Hello.

I have a dataset with Sales Prices for different Items, Customers and start/ending dates.
Like this:

Item NoCustomerStarting DateUnit PriceEnding Date
10000A01.01.201810031.12.2018
10000A01.01.201911031.12.2019
10000A01.01.2020120 
10000B01.01.201815031.12.2018
10000B01.01.201916031.12.2019
10000B01.01.2020170 
10000Dicount A01.01.20181031.12.2018
10000Dicount A01.01.20191131.12.2019
10000Dicount A01.01.202012 
20000A01.01.20185031.12.2018
20000A01.01.20196031.12.2019
20000A01.01.202070 
20000B01.01.20187031.12.2018
20000B01.01.20197531.12.2019
20000B01.01.202080 
20000Dicount A01.01.2018531.12.2018
20000Dicount A01.01.2019631.12.2019
20000Dicount A01.01.20207 

 

This is what I want:

IF Customer = A then subtract Discount A from A

IF Customer <> A then no subtraction

 

Expected result with filter Ending date = (blank):

Item NoSales codeUnit Price
10000A (minus disc)108
10000B170
20000A (minus disc)63
20000B80

 

Thanks!

 

Regards

Andreas

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

This does not look to be a DAX calculation but a Power Query one.

Best
D

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

This does not look to be a DAX calculation but a Power Query one.

Best
D

Oh, ok, I'll post it in the right forum then 🙂
Thanks 🙂

 

Mvh

Andreas

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.

Top Solution Authors