Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Dynamic benchmarking calculation based on slicer selection

Hello,

 

I have a dataset that looks something like this:

 

CampaignMailing ListDateOpen Rate
ASubscribers01/05/201615%
BCompetition03/09/201617%
CCompetition25/11/201623%
DSubscribers08/12/201614%
ECompetition04/01/201719%
FSubscribers15/01/201729%

 

What I'm trying to achieve (and failed so far) is to dynamically compare the Open Rate of a specific campaign that is chosen via a slicer in the report, against campaigns with similar characteristics, for example:

- Similar mailing list (e.g. if I choose Campaign F in the filter, I want to compare its Open Rate against the average Open Rate of all campaigns that went to Subscribers)

- YTD (e.g. if Campaign F is selected, compare its Open Rate against all campaigns that ran in 2017)

 

Any help is much appreciated!

 

Many thanks,

 

George.

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

@Anonymous

Hi George,

 

I've used your "Similar Mailing List" example, but similar logic should apply for your other example.

 

Before getting into the DAX, you need a measure that:

  1. Captures the Mailing Lists of currently selected Campaigns and adds to the filter context
  2. Clears the Campaign filter
  3. Calculates the Average Open Rate in this modified context

 

If I call your table Data, this sort of pattern would work:

 

Open Rate Average = 
AVERAGE ( Data[Open Rate] )

Open Rate Average for Same Mailing List as Selected Campaigns = 
CALCULATE (
    [Open Rate Average],
    SUMMARIZE ( Data, Data[Mailing List] ),
    ALL ( Data[Campaign] )
)

 

Sample pbix here

 

Notes:

  1. SUMMARIZE ( Data, Data[Mailing List] ) could be replaced with VALUES ( Data[Mailing List] ) since there is just a single table here, but SUMMARIZE would be needed if Mailing List was in a lookup table.
  2. The columns specified in SUMMARIZE determine the common attributes over which you want to calculate the average, so you can tweak this to whatever attributes you want.
  3. I cleared only the Campaign filter using ALL, so any other filters (date etc) are still applied. You could tweak this to clear more filters if you needed to.

Hope that helps as a starting point.

 

Cheers,

Owen 🙂


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

@Anonymous

Hi George,

 

I've used your "Similar Mailing List" example, but similar logic should apply for your other example.

 

Before getting into the DAX, you need a measure that:

  1. Captures the Mailing Lists of currently selected Campaigns and adds to the filter context
  2. Clears the Campaign filter
  3. Calculates the Average Open Rate in this modified context

 

If I call your table Data, this sort of pattern would work:

 

Open Rate Average = 
AVERAGE ( Data[Open Rate] )

Open Rate Average for Same Mailing List as Selected Campaigns = 
CALCULATE (
    [Open Rate Average],
    SUMMARIZE ( Data, Data[Mailing List] ),
    ALL ( Data[Campaign] )
)

 

Sample pbix here

 

Notes:

  1. SUMMARIZE ( Data, Data[Mailing List] ) could be replaced with VALUES ( Data[Mailing List] ) since there is just a single table here, but SUMMARIZE would be needed if Mailing List was in a lookup table.
  2. The columns specified in SUMMARIZE determine the common attributes over which you want to calculate the average, so you can tweak this to whatever attributes you want.
  3. I cleared only the Campaign filter using ALL, so any other filters (date etc) are still applied. You could tweak this to clear more filters if you needed to.

Hope that helps as a starting point.

 

Cheers,

Owen 🙂


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn
Anonymous
Not applicable

It worked a treat!! Many thanks Owen!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.