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
cshowe80
Helper I
Helper I

New Measure by Dividing two existing columns

I'm hoping I can get a bit of help. I've got two columns in my data tables and I'm trying to divide one by the other to give me a percentile output. 

 

It's a simple Click Through Rate (CTR) formula which is Clicks/Impressions. Ideally I would like to see a card visualization which shows just the CTR as a percentile output. 

 

 

DATA[CLICKS] is the first cloumn and DATA[IMPRESSIONS] is the other. 

 

Any help would be greatly apprecaited. 

1 ACCEPTED SOLUTION
KGrice
Memorable Member
Memorable Member

Hi @cshowe80. I'd start with creating three new measures. Names are up to you, but something like:

 

Sum of Clicks = SUM(DATA[CLICKS])

Sum of Impressions = SUM(DATA[IMPRESSIONS])

CTR = [Sum of Clicks] / [Sum of Impressions]

 

After you create the last measure, make sure you have it selected and you can also format it as a percent. If there's a possibility of a divide by 0 error, you can handle it instead with the DIVIDE function. You can provide a third parameter to specify how to handle an error, or leave it blank and it will return BLANK by default.

 

CTR = DIVIDE([Sum of Clicks], [Sum of Impressions])

 

If you need something more specific based on filter criteria or anything else, just let us know!

View solution in original post

3 REPLIES 3
KGrice
Memorable Member
Memorable Member

Hi @cshowe80. I'd start with creating three new measures. Names are up to you, but something like:

 

Sum of Clicks = SUM(DATA[CLICKS])

Sum of Impressions = SUM(DATA[IMPRESSIONS])

CTR = [Sum of Clicks] / [Sum of Impressions]

 

After you create the last measure, make sure you have it selected and you can also format it as a percent. If there's a possibility of a divide by 0 error, you can handle it instead with the DIVIDE function. You can provide a third parameter to specify how to handle an error, or leave it blank and it will return BLANK by default.

 

CTR = DIVIDE([Sum of Clicks], [Sum of Impressions])

 

If you need something more specific based on filter criteria or anything else, just let us know!

Anonymous
Not applicable

This solution worked out excellent, thank you @KGrice!

 

I had a similar situation where I needed to divide two existing columns (Direct Margin YearTotal / Revenue YearTotal) to produce a Direct Margin(%) measure to be applied to a Card visualization.

 

In my case, I broke it down like this:

Measure 1: Sum of DM(USD) = SUM('Data'[Direct Margin YearTotal])

Measure 2: Sum of Rev(USD) = SUM('Data'[Revenue YearTotal])

Measure 3: DM(%) = DIVIDE([Sum of DM(USD)], [Sum of Rev(USD)])

 

Measure 3 was applied to a Card visualization in the correct amount!

 

Thanks for the reply. I took your advice and it worked perfectly. I can't thank you enough. 

 

-C

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.