Forum Discussion
Mitchell92
2 years agoHelper II
Adding 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...
DataInsights
2 years agoSuper User
Would you be able to provide an example of data that appears in the wrong category? You could add additional rows to the shared pbix if that's easier.
Mitchell92
2 years agoHelper II
Hi DataInsights ,
PBIX link here: TEST - Debtors Point in Time2.pbix
Hopefully you can assist.
Thanks,
Mitch
- DataInsights2 years agoSuper User
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