Forum Discussion
Work down curve
- 6 years ago
Hi Anonymous ,
Try this:
1. Create a Calendar table.
Calendar = ADDCOLUMNS ( CALENDAR ( DATE ( 2020, 1, 1 ), DATE ( 2020, 12, 31 ) ), "YearMonth", FORMAT ( [Date], "YYYYMM" ), "Month-Year", FORMAT ( [Date], "MMM-YY" ) )2. Sort "Month-Year" column by "YearMonth" column.
3. Create the relationship between your fact table and Calendar table.
4. Create a Measure like so:
PELS LEFT = VAR CurrentDate = MAX ( 'Calendar'[Date] ) VAR CurrentYear = YEAR ( CurrentDate ) VAR CurrentMonth = MONTH ( CurrentDate ) VAR FirstDay = DATE ( CurrentYear, CurrentMonth, 1 ) RETURN IF ( MAX ( 'Calendar'[Month-Year] ) <> BLANK (), CALCULATE ( COUNT ( 'Table'[PEL_ID] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[CREDIT DATE] = BLANK () || 'Table'[CREDIT DATE] >= FirstDay ) ) )5. Create a Table visual and a Clustered column chart.
For more details, please check the attached PBIX file.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Try this:
1. Create a Calendar table.
Calendar =
ADDCOLUMNS (
CALENDAR ( DATE ( 2020, 1, 1 ), DATE ( 2020, 12, 31 ) ),
"YearMonth", FORMAT ( [Date], "YYYYMM" ),
"Month-Year", FORMAT ( [Date], "MMM-YY" )
)
2. Sort "Month-Year" column by "YearMonth" column.
3. Create the relationship between your fact table and Calendar table.
4. Create a Measure like so:
PELS LEFT =
VAR CurrentDate =
MAX ( 'Calendar'[Date] )
VAR CurrentYear =
YEAR ( CurrentDate )
VAR CurrentMonth =
MONTH ( CurrentDate )
VAR FirstDay =
DATE ( CurrentYear, CurrentMonth, 1 )
RETURN
IF (
MAX ( 'Calendar'[Month-Year] ) <> BLANK (),
CALCULATE (
COUNT ( 'Table'[PEL_ID] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[CREDIT DATE] = BLANK ()
|| 'Table'[CREDIT DATE] >= FirstDay
)
)
)
5. Create a Table visual and a Clustered column chart.
For more details, please check the attached PBIX file.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.