Hello to all,
I am trying to do some dashboards for Logistics departmento and I am having trouble calculating a weighted measure.
I have the calculated columnes "Lead Time" and "Dif Date".
Lead Time : Days between date create and date receipt
Dif Date : Days between date delivery and date receipt
Sample data:
What I want to do is to weight this two measures by the quantity receipt.
What I have done is exporting the data by provider and week to another table:
Provider & Week Level (Table) = ADDCOLUMNS( ALL( Table1[Provider] ; WEEKNUM ( Table1[date receipt] ); " Total received Quantity " ; Table1[received quantity] )
and importing that data back into the original table. This way I can divide the "Quantity Receipt" by the "total" from that provider and week.
For Weighted (column) = DIVIDE( Table1[received Quantity] ; RELATED( 'Provider & Week Level'[ Total received Quantity ] ) )
Weighted Lead Time = IF( HASONEFILTER( Table1[Provider] ); SUMX( Table1 ; [Lead Time (column)]*[For Weighted (column)] ); BLANK() )
This is not a really nice way to do it... but it is the only way I have found to do it.
The bad thing about this is that I can only view the weighted Lead time and Dif Date by provider and week, otherwise the measure is wrong.
"For Weighted (column)" has to be a measure that gives me the total of quantity receipt based on the filter applied on the slicers in the report.
E.G.: I would like to see the weighted lead time of the family 2 or store 3. The end user has to be able to play with all the slicers.
I hope you can help me...