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.
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.
Solved! Go to Solution.
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!
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!
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |