Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Thanks in advance!
Solved! Go to Solution.
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 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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |