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
DECRE83
Regular Visitor

sum measure from different cards

Hello,

 

So I have a page where I need to add certain steps on a transportation route. Each step of the route has a cost. At the end, I need a measure that sums the total of the individual steps, thus, giving me the total cost of the route.

 

DECRE83_0-1741820911849.png

 

The problem is that the measure I made is adding the total costs of all the different steps I have in my dataset, not filtering only the three steps in the specific route I selected in my slicers.

 

What can I do?

 

1 ACCEPTED SOLUTION
v-karpurapud
Community Support
Community Support

Hi  @DECRE83 
Welcome to the Microsoft Fabric Forum,

 

Regarding the measure to sum only the selected steps for the transportation route:

 

Since all step costs are stored in a single table, and the requirement is for the total to reflect only the steps selected through the slicers, a measure should be created that dynamically respects the current filter context.

 

Use SUMX function :

DAX:

Total Selected Route Cost = 
SUMX( VALUES(Table[StepID]), 
CALCULATE(SUM(Table[StepCost])) )


If steps are uniquely identified by multiple columns (category, location1,location2) adjust the measure:

DAX:

Total Selected Route Cost = 
SUMX( 
SUMMARIZE( Table, 
Table[Category], 
Table[Location1], 
Table[Location2] ), 
CALCULATE(SUM(Table[StepCost])) ) 

 

If this information helps resolve your issue, kindly consider marking this response as the Accepted Solution, as it may assist other community members facing similar challenges.

 

Thank you for being part of the Microsoft Fabric Community.



 

 

 

View solution in original post

4 REPLIES 4
v-karpurapud
Community Support
Community Support

Hi @DECRE83 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

v-karpurapud
Community Support
Community Support

Hi  @DECRE83 
Welcome to the Microsoft Fabric Forum,

 

Regarding the measure to sum only the selected steps for the transportation route:

 

Since all step costs are stored in a single table, and the requirement is for the total to reflect only the steps selected through the slicers, a measure should be created that dynamically respects the current filter context.

 

Use SUMX function :

DAX:

Total Selected Route Cost = 
SUMX( VALUES(Table[StepID]), 
CALCULATE(SUM(Table[StepCost])) )


If steps are uniquely identified by multiple columns (category, location1,location2) adjust the measure:

DAX:

Total Selected Route Cost = 
SUMX( 
SUMMARIZE( Table, 
Table[Category], 
Table[Location1], 
Table[Location2] ), 
CALCULATE(SUM(Table[StepCost])) ) 

 

If this information helps resolve your issue, kindly consider marking this response as the Accepted Solution, as it may assist other community members facing similar challenges.

 

Thank you for being part of the Microsoft Fabric Community.



 

 

 

DECRE83
Regular Visitor

thank you for your response!

 

The tables are not disconnected, the step costs are in a table that have the different cobinations with point a - point b - cost, point b - point c - cost.

 

So I can´t calculate three different measures to sum the steps since the data is in one table.

Deku
Super User
Super User

If you have a disconnected table for each of the cards with fields "category", "location1" and "location2". You then have 3 measures, one per card like

 

Calculate(

Sum(table[step cost]),

Treatas(

summarize(

disconnectedtable1,

disconnectedtable1[category], disconnectedtable1[location1], disconnectedtable1[location2]

), 

Summarize(

Table

Table[category],

Table[location1],

Table[location2]

)

)

 

Then for the total, sum the 3 measures together

 

Not sure on the structure of your model, but this kind of approach should work


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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