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

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

Reply
smallon
New Member

Issue with dynamic calculation based off of slicer selection

Hello,

 

I am a noobie here but trying to determine if this can be done. I am trying to calculate the total testing cost by multipling the test cost by the units sold. The issue I am running into is the cost of a test changes month to month. So when I put my calculation into the measure it sums the cost of the timeframe selected rather then calculating each month. How can this be done?

 

Example:

 

Jan-19 Test Cost is $18 Volume is 10

Feb-19 Test Cost is $19 Volume is 10

Mar-19 Test Cost is $25 Volume is 10

 

What I am getting:

Jan Cost: $180 (this is correct)

Jan-Feb Cost: $740 ($37 test cost x 20 volume)

Jan-Mar Cost: $1,860 ($62 test cost x 30 volume)

 

What I want to get:

Jan Cost: $180 (this is correct)

Jan-Feb Cost: $370 ($18 test cost x 10 volume, $19 test cost x 10 volume)

Jan-Mar Cost: $620 ($18 test cost x 10 volume, $19 test cost x 10 volume, $25 test cost x 10 volume)

 

Calculation: 

Total Cost = SUM('StarLIMS CPT'[Test Cost])*SUM('Total Rev'[Revenue Acode Volume])

 

I appreciate all the help!

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @smallon ,

 

To create measures as below.

 

Measure = SUM(Table1[testcost])*SUM(Table1[volume])
Measure 2 = CALCULATE(SUMX(Table1,[Measure]),FILTER(ALL(Table1),'Table1'[DATE]<=MAX('Table1'[DATE])))

Capture.PNG

 

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

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @smallon ,

 

To create measures as below.

 

Measure = SUM(Table1[testcost])*SUM(Table1[volume])
Measure 2 = CALCULATE(SUMX(Table1,[Measure]),FILTER(ALL(Table1),'Table1'[DATE]<=MAX('Table1'[DATE])))

Capture.PNG

 

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.