Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
NewB2PowerBI
Frequent Visitor

DAX. How to create a three step Percent calculation

Hello,

 

I'm trying to replicate a calculation I normaly do in an Excel Pivot.

I can't do it in the raw data because any combination of the number will be off.

I'm new to PowerBi, so looking for any advice.

 

It's a basic calculation for measuring online advertising revenue called eCPM.

The calculation in Excel is (Revenue/Impressions)*1000 and then formatted to Average.

Below is the exact calculation by my labels in an excel pivot.

=('Estimated revenue ($)' /'Ad impressions' )*1000

 

This has to be done in the Pivot, because the raw data set in Excel totals the eCPMs instead of averaging them, which inflates the number when doing multiple dates. For example, the $11.52 would be $16.13 if I didn't average the calculation on Excel Pivot.

 

I currently have the data uploaded from my Desktop in table into PowerBI Desktop.

 

Screen Shot 2018-01-02 at 10.16.44 PM.pngScreen Shot 2018-01-02 at 10.32.13 PM.png

1 ACCEPTED SOLUTION

Hi @NewB2PowerBI,

 

You may download my solution from here.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @NewB2PowerBI,

 

Could you please share a dummy sample? We need to write the DAX formula with data and its structure. The formula could be like this:

eCPM =
AVERAGEX (
    SUMMARIZE (
        'table1',
        'table1'[Device categories],
        'table1'[Date],
        "ecpm", 'table1'[Estimated revenue ($)] / 'table1'[Ad impressions]
            * 1000
    ),
    [ecpm]
)

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sure, attached is a dummie example data set. Below is a screen showing the results I'm trying to replicate. The one in yellow ($28.64) is the correct number, which is a pivot table calculated field. The one in orange ($34.53) is calculated in Excel and then brought into the Pivot. You can see how they don't align when they are totalled. Both are set as Averages in the pivot.

https://1drv.ms/x/s!AknODHFj5Qu4buOdkxp2KPWmL78

 

Screen Shot 2018-01-12 at 9.20.13 PM.png

Hi @NewB2PowerBI,

 

You may download my solution from here.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Super contributer indeed @Ashish_Mathur Thanks!

Thank you.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Sure, attached is a dummie example data set. Below is a screen showing the results I'm trying to replicate. The one in yellow ($28.64) is the correct number, which is a pivot table calculated field. The one in orange ($34.53) is calculated in Excel and then brought into the Pivot. You can see how they don't align when they are totalled. Both are set as Averages in the pivot.

https://1drv.ms/x/s!AknODHFj5Qu4buOdkxp2KPWmL78

 

Screen Shot 2018-01-12 at 9.20.13 PM.png

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors