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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AnthonyPOA
New Member

Date filter by departure year

I've got a report where it is counting all reservation days for each year by (arrival_date) i need to make sure the visual only counts reservation days that are in the same year.

 

Example: Reservation made on 10/1/22, the customer extends their stay into the next year (1/14/23) it doesnt count those 14 days in 2023 since the arrival date is 10/1/22.  I need to filter the report so it only counts reservations that have the same year for arrival and departure.

 

Hope that makes sense. Thanks!

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Create a calculated column formula

Check = 1*(year(Data[Arrival_date])=year(Data[reservation_date]))

Write this measure

Measure = countrows(filter(Data,Data[Check]=1))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks, i tried the above but i must be missing something, "Data" isnt a valid table. These are names of the columns i need to filter by on the database:

 

transientreservations.arrival

transientreservations.departure

 

Need to filter my visual so its only showing data that is same year for arrival and departure. I want to also be able to see current year. The above calculated column and measure dont seem to work or i'm doing something wrong. I may be creating them wrong. Am i supposed to then filter the report by the measure? I'm a novice when it comes to PowerBi, thanks again.

Data is the name of the Table.  In my measure, replace arrival_date with transientreservations.arrival and reservation date with transientreservations.departure


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.