Forum Discussion
Veronika3
10 months agoRegular Visitor
Duplicate total despite the filter used
Hello, I need help with this measure. I have a measure that works correctly only if I do not filter by country. This is how it looks when it’s correct: Meta test = IF ( SELECTEDVALUE ( fil...
- 10 months ago
Hi Veronika3
Please try
Meta test = IF ( SELECTEDVALUE ( filterHide[Text] ) <> "Hide", CALCULATE ( SUM ( factMetaCampaign[SpendEur] ), KEEPFILTERS ( TREATAS ( VALUES ( relCampaignSUParticipation[generatedID] ), factMetaCampaign[GeneratedID_PPID] ) ), KEEPFILTERS ( TREATAS ( VALUES ( relCampaignSUParticipation[Partner] ), factMetaCampaign[PartnerSUParticipation] ) ) ) )
Veronika3
10 months agoRegular Visitor
I was closest to the correct calculation here. However, it still did not include the country, so it was incorrectly summed.
IF (
SELECTEDVALUE ( filterHide[Text] ) = "Hide",
BLANK (),
SUMX (
VALUES ( relCampaignSUParticipation[Partner] ),
CALCULATE (
SUM ( factMetaCampaign[SpendEur] ),
KEEPFILTERS ( VALUES ( factMetaCampaign[dimSalesUnitBk] ) )
)
))
- Praful_Potphode10 months ago
Super User
Hi Veronika3 ,
Please try below measure:
Meta test = IF ( SELECTEDVALUE ( filterHide[Text] ) = "Hide", BLANK (), SUMX ( SUMMARIZE ( relCampaignSUParticipation, relCampaignSUParticipation[Partner], relCampaignSUParticipation[Country] ), CALCULATE ( SUM ( factMetaCampaign[SpendEur] ), KEEPFILTERS ( VALUES ( factMetaCampaign[dimSalesUnitBk] ) ) ) ) )Meta test Treat as= IF ( SELECTEDVALUE ( filterHide[Text] ) = "Hide", BLANK (), CALCULATE ( SUM ( factMetaCampaign[SpendEur] ), TREATAS ( VALUES ( relCampaignSUParticipation[Partner] ), factMetaCampaign[PartnerSUParticipation] ), TREATAS ( VALUES ( relCampaignSUParticipation[Country] ), factMetaCampaign[Country] ), TREATAS ( VALUES ( factMetaCampaign[dimSalesUnitBk] ), factMetaCampaign[dimSalesUnitBk] ) ) )If it doesnt work,please provide a clear snapshot of input/output.
Please give kudos or mark it as solution once confirmed.
Thanks and Regards,
Praful