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
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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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