The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Everyone,
I am trying to figure out how to create a table that has the first and last date of current month.
DAX expressions that I have tried:
Current_WholeMonth =
Var Mindate = MIN( TODAY() )
Var Maxdate = MAX( TODAY() )
Return
CALENDAR (Mindate, Maxdate)
But, it states an error that mentions MIN only accepts a column reference.
I was wondering if anyone has a workaround for this. If MIN only accepts a column reference, how should I change the DAX expressions so that it only returns the first and last date of the current month?
Expected output (As of 2nd September 2022):
Solved! Go to Solution.
Hi @Anonymous
please use
Current_WholeMonth =
VAR Maxdate =
EOMONTH ( TODAY (), 0 )
VAR Mindate =
EOMONTH ( TODAY (), -1 ) + 1
RETURN
CALENDAR ( Mindate, Maxdate )
Hi @Anonymous
please use
Current_WholeMonth =
VAR Maxdate =
EOMONTH ( TODAY (), 0 )
VAR Mindate =
EOMONTH ( TODAY (), -1 ) + 1
RETURN
CALENDAR ( Mindate, Maxdate )
Thank you very much! It works like a charm.
Hi,
Please try something like below.
It is for creating a new table.
Current_WholeMonth Table =
VAR _mindate =
EOMONTH ( TODAY (), -1 ) + 1
VAR _maxdate =
EOMONTH ( TODAY (), 0 )
RETURN
CALENDAR ( _mindate, _maxdate )
Thank you very much! Finally, get the table I wanted.
User | Count |
---|---|
26 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
30 | |
14 | |
12 | |
12 | |
7 |