The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello!
I have a bit of a weird request, which I'll give an example for shortly as I don't think i can accurately describe it.
Solutions can't use Powerquery/add columns as I don't have access to the data directly, and am only able to make measures using the data.
So here's the problem using an example:
Each day, we receive a variety of items. Each item is received in as multiple units, but I need to know how many boxes we received, which I calculate by dividing the units received by the pack size. So, for example, if we receive 24 pepsi cans, and each box contains 12, we received 24/12=2 boxes. Sometimes boxes are incomplete (so 23 pepsi cans instead of 24): in this case, we round up to the nearest box.
Calculating the number of boxes for each order isn't too hard: however, I need to know how many boxes we received over each day. How can I calculate that, keeping in mind that we often receive the same item multiple times each day, and that if I just take the sum of the items, I could get the wrong number of boxes. (For example, the first truck has 2 boxes of Pepsi can, sized 11 and 12. Another truck has a box of 1 Pepsi can. I need to have 3 calculated rather that (11+12+1)/12=2
Thanks!
Solved! Go to Solution.
@dwedding3 This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149
The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.
@dwedding3 This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149
The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.
Thank you for the help!