The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello!
I am looking to create a calendar table that starts with the first date in the below table where the Print Drop Column = Yes, and the last date is the last date in the below table.
I know how to create the table I am just not sure how to implement a condition with the "FIRSTDATE" function.
Thanks!
Solved! Go to Solution.
Hi @Ashoop2020 ,
You can create a calculated table as below, please find the details in the attachment.
Calendar =
VAR _mindate =
CALCULATE ( MIN ( 'Table'[date] ), 'Table'[Print Drop] = "Yes" )
VAR _maxdate =
CALCULATE ( MAX ( 'Table'[date] ), 'Table'[Print Drop] = "Yes" )
RETURN
CALENDAR ( _mindate, _maxdate )
Best Regards
Hi @Ashoop2020 ,
You can create a calculated table as below, please find the details in the attachment.
Calendar =
VAR _mindate =
CALCULATE ( MIN ( 'Table'[date] ), 'Table'[Print Drop] = "Yes" )
VAR _maxdate =
CALCULATE ( MAX ( 'Table'[date] ), 'Table'[Print Drop] = "Yes" )
RETURN
CALENDAR ( _mindate, _maxdate )
Best Regards
For a sound Date Table, this is not recommended. For date-time functions to work, DAX is very picky and demands that the date table begin on January 1st & end on December 31st.
Are you 100% sure this is what you want to do?
Regards,
Nathan
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
18 | |
18 | |
17 | |
15 | |
13 |
User | Count |
---|---|
36 | |
34 | |
19 | |
18 | |
16 |