Forum Discussion
Anonymous
3 years agoNot applicable
Deferred Revenue - Using Colum Headers in a filter
Hi all, New to PowerBi so I'm hoping someone can help here. I have a table of products that include an amount, contract length and amount paid. I want to build a deferred and current month releas...
Anonymous
3 years agoNot applicable
Hi Anonymous ,
I suggest you to create an unrelated Calendar table first ,then create a measure and show your result in a matrix.
Calendar =
ADDCOLUMNS (
CALENDARAUTO (),
"YearMonth",
YEAR ( [Date] ) * 100
+ MONTH ( [Date] ),
"YearMonthName", FORMAT ( [Date], "MMM-YYYY" ),
"MonthStart", EOMONTH ( [Date], -1 ) + 1
)
Measure:
Measure
=
VAR _GENERATE =
GENERATE (
VALUES ( 'Table'[Account] ),
SUMMARIZE ( 'Calendar', 'Calendar'[YearMonthName], 'Calendar'[MonthStart] )
)
VAR _ADDSUM =
ADDCOLUMNS (
_GENERATE,
"Sum",
SUMX (
FILTER (
'Table',
'Table'[Account] = EARLIER ( [Account] )
&& 'Table'[Start] <= EARLIER ( [MonthStart] )
&& 'Table'[End] > EARLIER ( [MonthStart] )
),
'Table'[Monthly]
)
)
RETURN
SUMX ( _ADDSUM, [Sum] )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous3 years agoNot applicable
Thanks RicoZhou, almost there, only issue I can't seem to fix is the YearMonthName is being displayed Month and year by by Month. Rather than Jan- Dec