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.
I am trying to create a measure where when I place it in a Pivot Table the values are displayed properly and not the sum of the values.
I have two tables, see below, and I want to multiply the Qty column by the appropriate pricing in column Price. The tables are called Table1 and Table2 respectively.
I created a measure called:
Prices := Calculate(SUM('Table2'[Price]))
and a measure called
Gross Profit := SUMX('Table1', 'Table1'[Qty] * [Prices]
When the data is displayed in a pivot table, the Prices are summed and I want the values to be the correct prices.
I have even tried the measure Prices := IF(HASONEVALUE('Table2'), Calculate(SUM('Table2'[Price]))) and that doesn't bring me back any value.
The Gross Profit measure works, however, I want the prices to be shown in my table.
Date | Description | Qty |
2/1/2019 | Gummy Bear | 165 |
2/1/2019 | Mints | 40 |
2/1/2019 | Chocolate | 30 |
2/2/2019 | Gummy Bear | 167 |
2/2/2019 | Mints | 39 |
2/2/2019 | Chocolate | 28 |
2/3/2019 | Gummy Bear | 169 |
2/3/2019 | Mints | 42 |
2/3/2019 | Chocolate | 30 |
Description | Price |
Gummy Bear | 1.44 |
Mints | 7.1 |
Chocolate | 2 |
Solved! Go to Solution.
Hi @Anonymous ,
There should be a relationship between these two tables. Then you can try this formula.
Measure = min('table2'[Price]) * sum('table2'[Qty])
Best Regards,
This indeed works when you bring it into the fact table. I was looking for a measure to write where I don't have to bring the variable into the fact table.
Thanks for the help and I'm marking this as solved!
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |