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.
I have a table with three columns, Job Number, Grand Total, and Account Name:
What would be the Dax expression to only calculate the sum grandtotal for a unique job? For example, KOL16800004, should only be $17600. Thanks!
Solved! Go to Solution.
In this scenario, you can first create a column to identify the duplicate rows.
DuplicateRows = CALCULATE ( COUNTROWS ( Table1 ), FILTER ( Table1, EARLIER ( Table1[Job Number] ) = Table1[Job Number] && EARLIER ( Table1[Grand Total] ) = Table1[Grand Total] && EARLIER ( Table1[Account Name] ) = Table1[Account Name] ) )
Then create a measure to get the grand total.
Total = IF ( MAX ( Table1[DuplicateRows] ) > 1, MAX ( Table1[Grand Total] ), SUM ( Table1[Grand Total] ) )
Best Regards,
Herbert
In this scenario, you can first create a column to identify the duplicate rows.
DuplicateRows = CALCULATE ( COUNTROWS ( Table1 ), FILTER ( Table1, EARLIER ( Table1[Job Number] ) = Table1[Job Number] && EARLIER ( Table1[Grand Total] ) = Table1[Grand Total] && EARLIER ( Table1[Account Name] ) = Table1[Account Name] ) )
Then create a measure to get the grand total.
Total = IF ( MAX ( Table1[DuplicateRows] ) > 1, MAX ( Table1[Grand Total] ), SUM ( Table1[Grand Total] ) )
Best Regards,
Herbert
@v-haibl-msft Do you have to add all the columns in the expression? I have a similar situation but with many more columns.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |