March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello everybody!
I need to add a column to my calendar to filter in my views just for completed months.
The calendar I am using is a fiscal calendar like
Date - Fiscal Month
Does someone know any dax function to get a False/ True, of the date is within a completed fiscal month?
Solved! Go to Solution.
// Let's say that FiscalMonthID is
// a unique identifier of a fiscal
// month in Calendar.
[Full Fiscal Month] = // calculated column
var __today = TODAY()
var __currentFiscalMonth = Calendar[FiscalMonthID]
var __allFiscalMonthDatesAreOK =
ISEMPTY(
FILTER(
'Calendar',
Calendar[FiscalMonthID] = __currentFiscalMonth
&&
Calendar[Date] > __today
)
)
RETURN
__allFiscalMonthDatesAreOK
Best
D
This should get your desired result in a calculated column (this example is on the Date table).
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Perfect - very simple but does the job!!
@mahoneypat Thanks a lot! Are you sure this works with a fiscal month with individual end dates for each month (mentioned in starting post)?
// Let's say that FiscalMonthID is
// a unique identifier of a fiscal
// month in Calendar.
[Full Fiscal Month] = // calculated column
var __today = TODAY()
var __currentFiscalMonth = Calendar[FiscalMonthID]
var __allFiscalMonthDatesAreOK =
ISEMPTY(
FILTER(
'Calendar',
Calendar[FiscalMonthID] = __currentFiscalMonth
&&
Calendar[Date] > __today
)
)
RETURN
__allFiscalMonthDatesAreOK
Best
D
It won't work for fiscal months. I forgot about that part. What is your logic to determine the fiscal month. If you share it, I will try an alternate expression.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
The fiscal months are based on the fiscal weeks:
Week 1-4 = January
Week 5-8 = February
Week 9-13 = March
The measure is:
Thanks for the reply!
A month is completed when every day is in the past
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
15 | |
12 | |
9 | |
8 |
User | Count |
---|---|
41 | |
32 | |
29 | |
12 | |
12 |