Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hello everyone,
I'm trying to create a measure to divide quantity value of the current date by the value of the first date that appears forthe month.
(e.g. 31 May Item A quantity value divided by 17 May Item A quantity value)
(e.g. 24 May Item A quantity value divided by 17 May Item A quantity value)
(e.g. 17 May Item A quantity value divided by 17 May Item A quantity value)
Thanks in advance!
Solved! Go to Solution.
@Anonymous,
Try this measure:
Percentage =
VAR vCurrentQty =
SUM ( 'Item'[Quantity] )
VAR vCurrentYear =
YEAR ( MAX ( 'Item'[Date] ) )
VAR vCurrentMonth =
MONTH ( MAX ( 'Item'[Date] ) )
VAR vFirstDateInMonth =
CALCULATE (
MIN ( 'Item'[Date] ),
ALLEXCEPT ( 'Item', 'Item'[Item] ),
YEAR ( 'Item'[Date] ) = vCurrentYear,
MONTH ( 'Item'[Date] ) = vCurrentMonth
)
VAR vEarliestQtyInMonth =
CALCULATE (
SUM ( 'Item'[Quantity] ),
ALLEXCEPT ( 'Item', 'Item'[Item] ),
'Item'[Date] = vFirstDateInMonth
)
VAR vResult =
DIVIDE ( vCurrentQty, vEarliestQtyInMonth )
RETURN
vResult
Sample data:
Proud to be a Super User!
@Anonymous,
Try this measure:
Percentage =
VAR vCurrentQty =
SUM ( 'Item'[Quantity] )
VAR vCurrentYear =
YEAR ( MAX ( 'Item'[Date] ) )
VAR vCurrentMonth =
MONTH ( MAX ( 'Item'[Date] ) )
VAR vFirstDateInMonth =
CALCULATE (
MIN ( 'Item'[Date] ),
ALLEXCEPT ( 'Item', 'Item'[Item] ),
YEAR ( 'Item'[Date] ) = vCurrentYear,
MONTH ( 'Item'[Date] ) = vCurrentMonth
)
VAR vEarliestQtyInMonth =
CALCULATE (
SUM ( 'Item'[Quantity] ),
ALLEXCEPT ( 'Item', 'Item'[Item] ),
'Item'[Date] = vFirstDateInMonth
)
VAR vResult =
DIVIDE ( vCurrentQty, vEarliestQtyInMonth )
RETURN
vResult
Sample data:
Proud to be a Super User!
Thank you for your help kind sir, have a good weekend 😉