Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Solved! Go to Solution.
Hi,
I am not sure how your expected result looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
In the sample, I tried to use GENERATE DAX Function to create a new table.
GENERATE function (DAX) - DAX | Microsoft Learn
DateTable =
GENERATE (
ADDCOLUMNS (
CALENDAR ( DATE ( 2021, 1, 1 ), DATE ( 2024, 12, 31 ) ),
"Year", YEAR ( [Date] ),
"Month Number", MONTH ( [Date] )
),
SELECTCOLUMNS (
FILTER (
FileSemesters,
( FileSemesters[StartDate] <= [Date]
&& FileSemesters[EndDate] >= [Date] )
),
"TermOfYear", FileSemesters[Semesters]
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
DateTable =
ADDCOLUMNS(
CALENDAR(DATE(2016, 1, 1), DATE(2024, 12, 31)),
"Year", YEAR([Date]),
"Month Number", MONTH([Date]),
"Semester",
VAR currentDate = [Date]
RETURN
MAXX(
FILTER(
FileSemesters,
FileSemesters[StartDate] <= currentDate &&
FileSemesters[EndDate] >= currentDate
),
FileSemesters[Semester]
)
)
You can then use this DateTable in your model to relate dates to semesters seamlessly.
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
hi @JG_Austra ,
try like:
DateTable =
ADDCOLUMNS(
CALENDAR(DATE(2016, 1, 1), DATE(2024, 12, 31)),
"Year", YEAR([Date]),
"Month Number", MONTH([Date]),
"Semester",
VAR currentDate = [Date]
RETURN
MAXX(
FILTER(
FileSemesters,
FileSemesters[StartDate] <= currentDate &&
FileSemesters[EndDate] >= currentDate
),
FileSemesters[Semester]
)
)
You can then use this DateTable in your model to relate dates to semesters seamlessly.
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
Hi,
I am not sure how your expected result looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
In the sample, I tried to use GENERATE DAX Function to create a new table.
GENERATE function (DAX) - DAX | Microsoft Learn
DateTable =
GENERATE (
ADDCOLUMNS (
CALENDAR ( DATE ( 2021, 1, 1 ), DATE ( 2024, 12, 31 ) ),
"Year", YEAR ( [Date] ),
"Month Number", MONTH ( [Date] )
),
SELECTCOLUMNS (
FILTER (
FileSemesters,
( FileSemesters[StartDate] <= [Date]
&& FileSemesters[EndDate] >= [Date] )
),
"TermOfYear", FileSemesters[Semesters]
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
25 | |
12 | |
9 | |
9 | |
9 |
User | Count |
---|---|
19 | |
14 | |
14 | |
13 | |
12 |