March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Register NowGet certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Good morning, I have a table with a column with continuous dates between today and 2 years ago.
I am trying to use the code below to create a table with time periods. My intent is to create a column where dates from today to 1 year ago are given a label, and dates from 1 year ago to 2 years, are given another label.
My code returns a blank table.
Can someone point me in the right direction on how to fix this?
Solved! Go to Solution.
Hi @Anonymous
Please try
Date Periods =
ADDCOLUMNS (
CALENDAR ( TODAY () - 730, TODAY () ),
"Type",
IF ( [Date] < TODAY () - 365, "Vendor 2 Year", "Asset 1 Year" )
)
Hi @Anonymous
Please try
Date Periods =
ADDCOLUMNS (
CALENDAR ( TODAY () - 730, TODAY () ),
"Type",
IF ( [Date] < TODAY () - 365, "Vendor 2 Year", "Asset 1 Year" )
)
@tamerj1 Thank you for your time in getting this for me. Will this table only hold 2 years worth of dates and each new day, the table will recalculate itself and the last date disappears?
Lola
@Anonymous
Exactly
@Anonymous Hi!
Try with:
Date Periods =
UNION(
ADDCOLUMNS(
FILTER(MyDate, MyDate[Date] >= TODAY() && MyDate[Date] < TODAY() - 365),
"Type", "Asset 1 Year"
),
ADDCOLUMNS(
FILTER(MyDate, MyDate[Date] >= TODAY() - 365 && MyDate[Date] < TODAY() - 730),
"Type", "Vendor 2 Year"
)
)
BBF
Thank you for the response, once again I get a blank table.
here is the code for my date table if that helps, it is just dates, unsummarized, formatted in DD/MM/YYYY (Short Date)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Check out the November 2024 Power BI update to learn about new features.
User | Count |
---|---|
31 | |
19 | |
15 | |
14 | |
10 |
User | Count |
---|---|
62 | |
25 | |
24 | |
22 | |
16 |