Forum Discussion
Calculating through unique values
- 3 years ago
Hi, Anonymous
Based on the data given, it seems you want to sum the "Quote value" for each distinct "QuoteID" when "Valid" is TRUE. However, the problem you're encountering is that "Quote value" is repeated for each row of the same "QuoteID". This is causing the sum to be much larger than it should be.
To solve this in Power BI, you can create a measure which first calculates the unique quote values and then sum them up. Here's an example of how you might accomplish this using DAX.
Valid Quote Total = SUMX( SUMMARIZE( FILTER('YourTable', 'YourTable'[Valid] = TRUE), 'YourTable'[QuoteID], "QuoteValue", MAX('YourTable'[Quote value]) ), [QuoteValue] )
Hi, Anonymous
Based on the data given, it seems you want to sum the "Quote value" for each distinct "QuoteID" when "Valid" is TRUE. However, the problem you're encountering is that "Quote value" is repeated for each row of the same "QuoteID". This is causing the sum to be much larger than it should be.
To solve this in Power BI, you can create a measure which first calculates the unique quote values and then sum them up. Here's an example of how you might accomplish this using DAX.
Valid Quote Total =
SUMX(
SUMMARIZE(
FILTER('YourTable', 'YourTable'[Valid] = TRUE),
'YourTable'[QuoteID],
"QuoteValue", MAX('YourTable'[Quote value])
),
[QuoteValue]
)
- Anonymous3 years agoNot applicable
It works exactly as intended, thank you rubayatyasmin
- rubayatyasmin3 years agoCommunity Champion
Happy to help