Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213916

Using Dax to remove duplicates before summing up a column

$
0
0

Hello,

 

This is a dax query that I have used to create a measure. 

 CALCULATE(SUM(Invoice[AmountDueAUD]), Invoice[Type]="ACCREC")

The problem is that there are multiple rows with the same invoice number and each row has the same value in AmountDueAUD column. So I want to remove the duplicate invoices before summing up the AmountDueAUD column. I know I can remove the duplicates using "Remove Duplicates" option, but there are other charts in my report that require that multiple columns. So, I want to achieve removing duplicates using Dax. I tried this but didn't work:

CALCULATE(SUM(Invoice[AmountDueAUD]), DISTINCT(Invoice[InvoiceNumber]), Invoice[Type]="ACCREC")

Thank You

 

 


Viewing all articles
Browse latest Browse all 213916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>