Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
New to DAX. I have a single values column (Units) and another column with Scenario. . I am trying to create a DAX calc that subtracts Scenario 1 from Scenario 2 on each line item.
Here's my data table below as well as a screenshot of the pivot table view I'm trying to recreate (Pivot Table View), specifically the Deltas section, but would like to leverage DAX. Currently, I'm using power query to create calculated columns for the Deltas to create a new scenario called Deltas, then stitching it as a third scenario. This is resource intensive when done over many columns/rows.
Customer | Product | Scenario | Quarter | Units | Price |
Customer A | Product A | Scenario 1 | CQ1-23 | 55 | $49.00 |
Customer B | Product A | Scenario 1 | CQ1-23 | 81 | $77.00 |
Customer C | Product B | Scenario 1 | CQ1-23 | 23 | $98.00 |
Customer A | Product A | Scenario 1 | CQ2-23 | 98 | $62.00 |
Customer B | Product A | Scenario 1 | CQ2-23 | 67 | $61.00 |
Customer C | Product B | Scenario 1 | CQ2-23 | 78 | $8.00 |
Customer A | Product A | Scenario 2 | CQ1-23 | 38 | $45.00 |
Customer B | Product A | Scenario 2 | CQ1-23 | 73 | $79.00 |
Customer C | Product B | Scenario 2 | CQ1-23 | 27 | $22.00 |
Customer A | Product A | Scenario 2 | CQ2-23 | 79 | $90.00 |
Customer B | Product A | Scenario 2 | CQ2-23 | 39 | $74.00 |
Customer C | Product B | Scenario 2 | CQ2-23 | 5 | $79.00 |
I am trying to create a DAX calc that subtracts Scenario 1 from Scenario 2 on each line item.
Please define what you mean by "line item". Power BI aggregates everything automatically, and the only way to prevent that is to have unique values in each line - which you don't have.
Other than that you can use filters to calculate the required measure
Appreciate the response! I'm actually working within Excel's data model and trying to recreate the view with DAX in the linked image below which shows the unit delta between scenarios. (and additionally could add Revenue, Price deltas etc as well). Pivot Table View
The view you show in Power BI is close, except difficult to read with the Deltas being shown as a column and duplicated, vs being shown as third row beneath Scenario 2.
Your desired outcome is a little contrary to Power BI's philosophy. You might be better off if you continue to use Excel for that.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |