Forum Discussion
Sum for filtered in distinct value
- 6 years ago
Hello az38 , thanks for the revert. i had run your code, it give me a constant value regardless of date
On modifying the code slightly i.e. removing the filter expression ALL(Query), this gave me the correct output as expected
Total PAX = CALCULATE(SUMX(SUMMARIZE('Query1','Query1'[Sec], "Total PAX", MAX(Query1[PAX])), [Total PAX]))
hello aj1973,
the above table is only a synopsis of the table data. the duplicate data comes due to a left join condition in sql which cannot be avoided due to data beign pulled in from other tables.
doesn't matter how it is linked in the source SQL. If you are willing to remove the duplicate then use Power query in query editor to clean and transform your data. Remember, for performance purposes you need to clean, get rid of none necessary data and transform data in Query Editor to get the most in your visuals and the use of DAX in the Power BI desktop.
Regards