Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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]
)
)
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]
)
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
8 | |
8 |
User | Count |
---|---|
13 | |
12 | |
11 | |
10 | |
9 |