Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Creating Upcoming Events Calendar

Hello,

I have a data set that records training courses that people have attended, and when the course expires and the person will have to attend it again.

I need help in writing a measure that will show me which people have expiry dates coming up, preferably a week in advance.

 

The relevant data is stored in 4 columns, first name, Surname, course date (the date they attended the course), and expire date.

Is this possible?

Thanks

1 ACCEPTED SOLUTION
technolog
Super User
Super User

Certainly! Assuming you're working with Power BI, you can use a DAX measure to achieve this. Here's a step-by-step guide:

1. Load Data
First, make sure your data is loaded into a Power BI table. Let's call this table TrainingCourses.

2. Create a Measure
You can create a measure that checks if the expire date falls within the next week. This measure will return a "1" if the expiration date is within the next week and "0" otherwise.

Go to your TrainingCourses table and then click on New Measure.

Expiry_In_Next_Week =
VAR CurrentDate = TODAY()
VAR OneWeekLater = CurrentDate + 7

RETURN
IF(
AND([expire date] >= CurrentDate, [expire date] <= OneWeekLater),
1,
0
)
3. Filter Data
Now that you have the measure, you can create a visual (like a table) to show only those records where Expiry_In_Next_Week is 1.

Add a table to your report.
Drag the columns "first name", "Surname", "course date", and "expire date" to the values of the table.
Now, you can apply a filter to this table. Go to the filters pane, click on the measure Expiry_In_Next_Week, and set it to be equal to 1.
This table will now show only those people whose courses will expire within the next week.

Optional
If you want to highlight these dates or present them in a more visually appealing way, consider using Conditional Formatting.

View solution in original post

1 REPLY 1
technolog
Super User
Super User

Certainly! Assuming you're working with Power BI, you can use a DAX measure to achieve this. Here's a step-by-step guide:

1. Load Data
First, make sure your data is loaded into a Power BI table. Let's call this table TrainingCourses.

2. Create a Measure
You can create a measure that checks if the expire date falls within the next week. This measure will return a "1" if the expiration date is within the next week and "0" otherwise.

Go to your TrainingCourses table and then click on New Measure.

Expiry_In_Next_Week =
VAR CurrentDate = TODAY()
VAR OneWeekLater = CurrentDate + 7

RETURN
IF(
AND([expire date] >= CurrentDate, [expire date] <= OneWeekLater),
1,
0
)
3. Filter Data
Now that you have the measure, you can create a visual (like a table) to show only those records where Expiry_In_Next_Week is 1.

Add a table to your report.
Drag the columns "first name", "Surname", "course date", and "expire date" to the values of the table.
Now, you can apply a filter to this table. Go to the filters pane, click on the measure Expiry_In_Next_Week, and set it to be equal to 1.
This table will now show only those people whose courses will expire within the next week.

Optional
If you want to highlight these dates or present them in a more visually appealing way, consider using Conditional Formatting.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.