Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Currently I have the following measure for calculating 'engagement':
Engagement % = DIVIDE(SUM(DATASET[clicks]),SUM(DATASET [impressions]))
DATASET
impressions | clicks | source | Impressionsv2 |
56 | 34 | web |
|
353 | 23 | media |
|
53 | 11 | other1 |
|
353 | 12 | 34 | |
35 | 32 | social |
|
However, I now have a new column I need to use for calculating the engagement for email source only. i.e. for email only I need to calculate the clicks against data in another column.
i.e. If source = ‘media’ then engagement should be clicks/impressionsv2, otherwise for all other sources it should be calculated as clicks/impressions
Solved! Go to Solution.
@stevemdata Sorry Replace this part with "email"
Engagement % =
VAR _prct =
DIVIDE(
SUM('DATASET'[clicks]),
SUM('DATASET'[impressions])
)
VAR _media_email = CALCULATE( SUM('DATASET'[clicks]), 'DATASET'[source] = "email")
return
IF( SELECTEDVALUE('DATASET'[source]) = "email", DIVIDE( _media_email, CALCULATE( SUM('DATASET'[Impressionsv2]), 'DATASET'[source] = "email")),_prct)
Hi @stevemdata
Try it
Engagement % =
VAR _prct =
DIVIDE(
SUM('DATASET'[clicks]),
SUM('DATASET'[impressions])
)
VAR _media_email = CALCULATE( SUM('DATASET'[clicks]), 'DATASET'[source] = "media")
return
IF( SELECTEDVALUE('DATASET'[source]) = "media", DIVIDE( _media_email, CALCULATE( SUM('DATASET'[Impressionsv2]), 'DATASET'[source] = "email")),_prct)
Hi @DimaMD thank you!
Unfortunately I made a mistake in my question above, i meant to say if i.e. If source = ‘email’ then engagement should be clicks/impressionsv2, otherwise for all other sources it should be calculated as clicks/impressions.
So in your table the engagement for email row should be 12/34 = 35%
are you able to update your solution please with this in mind? thank you
@stevemdata Sorry Replace this part with "email"
Engagement % =
VAR _prct =
DIVIDE(
SUM('DATASET'[clicks]),
SUM('DATASET'[impressions])
)
VAR _media_email = CALCULATE( SUM('DATASET'[clicks]), 'DATASET'[source] = "email")
return
IF( SELECTEDVALUE('DATASET'[source]) = "email", DIVIDE( _media_email, CALCULATE( SUM('DATASET'[Impressionsv2]), 'DATASET'[source] = "email")),_prct)
perfect! thanks
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.