Forum Discussion
sum measure from different cards
- 1 year ago
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.
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