Serdia
Serdia

Reputation: 4426

How to generate calendar table for each calendar month and make it stop as of today in Power BI

I am able to generate calendar table for each month, but it goes till the end of current month.

CalendarTest = 
SUMMARIZE(
    ADDCOLUMNS(
        CALENDAR ("01-01-2018", TODAY()),
        "Month", EOMONTH([Date], - 1) + 1
              ),
              [Month],
              "Eomonth",EOMONTH([Month],0)

enter image description here

But the last value for Eomonth should be today's date. Not the end of the month.

Need it to be like that:

enter image description here

Upvotes: 0

Views: 141

Answers (1)

Olly
Olly

Reputation: 7891

Try

CalendarTest = 
SUMMARIZE(
    ADDCOLUMNS(
        CALENDAR ("01-01-2018", TODAY() ),
        "Month", EOMONTH ( [Date], - 1) + 1
    ),
    [Month],
    "Eomonth", MIN ( EOMONTH([Month],0), TODAY() )
)

Upvotes: 0

Related Questions