Forum Discussion
Mitchell92
Helper II
2 years agoAdding Switch Results to Matrix (or different solution)
Hi all, I'm hoping someone may be able to assist. I have a list of invoice #'s with invoice date and amount, and also a calendar table with a relationship between the invoice date and calenda...
Mitchell92
Helper II
2 years agoHi DataInsights ,
PBIX link here: TEST - Debtors Point in Time2.pbix
Hopefully you can assist.
Thanks,
Mitch
DataInsights
Super User
2 years ago
Try this measure:
AgeBrackets =
VAR vLowerBound =
SELECTEDVALUE ( AgeBracket[Lower Bound] )
VAR vUpperBound =
SELECTEDVALUE ( AgeBracket[Upper Bound] )
VAR vMaxDate =
MAX ( DateTable[Date] )
VAR vResult =
SUMX (
Invoicing,
VAR vInvDate = Invoicing[Date]
VAR vAge = DATEDIFF ( vInvDate, vMaxDate, DAY )
RETURN
IF ( vAge >= vLowerBound && vAge <= vUpperBound, [Sum of Total] )
)
RETURN
vResult