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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
vincenardo
Helper I
Helper I

Formula Help

I have a table in PBI desktop that I have grouped the data in a matrix report like this -

vincenardo_2-1645720848822.png

The Rows being used in the table are;

vincenardo_1-1645720801431.png

As you can see in the above matrix, the first row is blank for the 'campaign type'.

When I have the matrix collapsed, I successfully get the 'CPL' value which is

DIVIDE([Total Spend], SUM('R105'[Raw]))

 

My issue is that I need to calculate this value ($126 in the above example) and then mutiply it times the Raw for each ProjectName/Campaign type so when I expand out the matrix, I can see the 'CPL' for each Campaign Type.

 

Any suggestions on how this formula would be created?

Thanks in advance!!

3 REPLIES 3
AllisonKennedy
Community Champion
Community Champion

@vincenardo  You can use the ISINSCOPE function for this, for example:

 

CPL all = IF( ISINSCOPE ( Table[CampaignType], [CPL] * [Raw], [CPL] )

 

Trouble is, your CPL is showing as $0 for the CampaignType level, so you'll need to edit it further:

 

CPL all = IF( ISINSCOPE ( Table[CampaignType],
CALCULATE ( [CPL], ALL(Table[CampaignType]) ) * [Raw], [CPL] )


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

lbendlin
Super User
Super User

What is your expected outcome?  the value for "Raw" in that row is 0 ?

I would like to use the value for 'CPL' based on the rolled up total of the 'Project Name' (CPL = $126) then use that result for the 'campaign types' under the 'project name' and multiply the 'RAW' x the 'CPL' for each;

 

Internet - $126 (CPL) x 472 (RAW) = $59,472.00

Magazine - $126 (CPL) x 2025 (RAW) = $255,150.00

Showroom - Anaheim - $126 (CPL) x 3 = $378.00

 

Thanks!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.