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 to get the cost for each delivery. My table looks like:
Deliver | Item | Delivery Cost |
A | 1 | $1 |
A | 2 | $1 |
A | 3 | $1 |
A | 4 | $1 |
A | 5 | $1 |
B | 6 | $20 |
B | 7 | $20 |
B | 8 | $5 |
C | 9 | $5 |
The measure should show the cost as:
A = $1
B = $20
C=$5
Solved! Go to Solution.
Did you try max function?
Measure = Max(Table[Delivery Cost])
OR
Choose Maximum in the dropdown.
If this helps, mark it as a solution.
Kudos are nice too
Hello, I have a table wit deliveries and items for each delivery along with a cost for each delivery. How can I create a measure to get the cost for each distinct delivery. My data looks like this:
Deliver | Item | Delivery Cost |
A | 1 | $1 |
A | 2 | $1 |
A | 3 | $1 |
A | 4 | $1 |
A | 5 | $1 |
B | 6 | $20 |
B | 7 | $20 |
B | 8 | $5 |
C | 9 | $5 |
So the measure for the cost for each delivery should be:
A = $1
B = $20
C = $5
Hi @TomSinAA ,
We can use the following measure in visual to meet your requirement, it will calculate the cost for different divery in visual.
Cost Measure = MAX('Table'[Delivery Cost])
If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.
Best regards,
One option would be to use a measure like the following
Total Delivery Cost =
var _costs = SUMMARIZE('Table','Table'[Deliver],'Table'[Delivery Cost])
return sumx(_costs,[Delivery Cost])
The other way of doing this would be to split the item level data into one table and the delivery based data into another table as it looks like you have data of mixed grain in this table which is what causes issues like this. This will complicate your data load and require you to build a proper star schema with dimension tables linked to each of the different fact tables, but it will simplify and speed up measures like this.
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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |