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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Rovisonn
Frequent Visitor

Summarizing rows with one baseline row

Hi everyone,

 

I'm a bit stuck with a DAX issue. I was hoping anyone could help me out with a solution. 

 

I have a dataset with cities, strategies and cost. The dataset contains over 150 cities. Each city has a baseline strategy and three alternative strategies (rows) with costs (columns). I'm trying to calculate the total costs for each strategy within each city. The issue however is that the costs for each strategy are relative to the baseline costs. 

 

Below is an excel image I created of a simple dataset and the result I'm expecting. 

 

dax.jpg

Thanks in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

It is a fairly simple scenario, but we need to see the model.

If that is simply a single table, you can have a calculated column

 

Cost Including Baseline=
Var thisCity=Table[City]
var thisSumCost=Table[SumCost]
var BaselineCost=SUMX(Filter(Table;Table[City]=thisCity && Table[Strategy]="Baseline");Table[SumCost])

RETURN
BaselineCost+thisSumCost

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

It is a fairly simple scenario, but we need to see the model.

If that is simply a single table, you can have a calculated column

 

Cost Including Baseline=
Var thisCity=Table[City]
var thisSumCost=Table[SumCost]
var BaselineCost=SUMX(Filter(Table;Table[City]=thisCity && Table[Strategy]="Baseline");Table[SumCost])

RETURN
BaselineCost+thisSumCost

It worked like a charm.

 

Thanks a lot!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.