Forum Discussion
Average between two columns not correct
- 3 years ago
Hi jhlatinia ,
The result you get is incorrect is because it is the sum of all rows. In other words, they calculate the percentage of each row first and then sum it, which gives a different result than summing and then calculating the percentage.
Please try:
CTR = VAR _a = SUMMARIZE ( 'Table', 'Table'[Campaign Group Name], "CTR", DIVIDE ( CALCULATE ( SUM ( 'Table'[Clicks] ), FILTER ( 'Table', [Campaign Group Name] = EARLIER ( 'Table'[Campaign Group Name] ) ) ), CALCULATE ( SUM ( 'Table'[Impressions] ), FILTER ( 'Table', [Campaign Group Name] = EARLIER ( 'Table'[Campaign Group Name] ) ) ) ) ) RETURN AVERAGEX ( _a, [CTR] )Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi jhlatinia ,
What does your Start Date look like? What is the relationship between the date and the value?
Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?
Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Refer to:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
This is the format.