Forum Discussion
Divide By Different Aggregations
Hello,
Apologies as I am still new to PowerBI. How can I get a divided measure based on 2 fields (Week and Channel)? For example I have:
For CPC, I would like Act-Spend/Act-Clicks, which is what is showing in CPC. My question is more on the CPC in the week start row. The AVG CPC is taking the average of the rows below, but I would like it to instead show $82509.95/8267. How can I create a calculation to show that while still leaving the other channels in place?
How is your average measure defined? If you define it as DIVIDE ( [Act-Spend], [Act-Clicks] ), then you should be fine (assuming you've already defined each of those measures).
Hi,
Use these measures
Spend = sum(consol[Act-Spend])
Clicks = sum(consol[Act-clicks])
CPC = divide([spend],[clicks])
Hope this helps.
5 Replies
- AlexisOlsonSuper User
How is your average measure defined? If you define it as DIVIDE ( [Act-Spend], [Act-Clicks] ), then you should be fine (assuming you've already defined each of those measures).
- yachoiFrequent Visitor
Yes, that's exactly how I have it:
CPC = DIVIDE((consol[Act-Spend]),(consol[Act-Clicks]))It works for each of the channel, but the rolled up view still is an average of the fields underneath.- Ashish_MathurSuper User
Hi,
Use these measures
Spend = sum(consol[Act-Spend])
Clicks = sum(consol[Act-clicks])
CPC = divide([spend],[clicks])
Hope this helps.
- yachoiFrequent Visitor
Thank you to both. I realized that I was using it as columns instead of measures, which was the issue.
Both solutions work, just needed to use it as a measure.
Thanks again!
- Ashish_MathurSuper User
You are welcome.