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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
shooyi
New Member

Is it possible to subtract two selectedmeasure in calculated group?

Matrix is using a calculated group. A and B are two different measures. Is it possible to have a calculated item that does A-B?

 

shooyi_1-1684266178360.png

 

2 REPLIES 2
Wilson_
Super User
Super User

Hello shooyi,

 

Are you looking for it to subtract A and B specifically? Does Measure = A - B not work? I must be missing something here!


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi Wilson

 

I created a calculated group because I needed the same 5 custom calculations applied to whatever measure I drop in.

 

What is in the table is the YoY %. So A is the YoY growth for measure A and B is the YoY growth for measure B for a client defined time metric.

 

But I need A and B to able to be applied to the sum of any column.

 

Example :

 

A could be the sum(company_a_sales) or sum(company_a_units)

B could be the sum(company_b_sales) or sum(company_b_units)

 

What I was trying to do is the 5 custom calculations (client defined rolling metrics a, b, c, d, e) and have it use selectedmeasure() instead of creating 30 measures.

So I would be able to use :

rolling_metric_a - using selectedmeasure()

as opposed to

rolling_metric_a for each column

 

yearweekproductcompany_a_salescompany_a_unitscompany_b_salescompany_b_unitscompany_c_salescompany_c_units
14xx123534567878945
15yy321356548798754
24xx852251474136963
25yy963637533515915

 

This works just fine. Now I need to be able to subtract the two. So in the original post that is the rolling_metric_a applied to sum(company_a_sales) and sum(company_b_sales).

I now need the difference between the two.

 

Is it possible to create a calculated item that subtracts the two?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.