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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Samhunt
Helper II
Helper II

Need Help with Sax

Hello guys, 

 

I want to count all different bookings that happened within a calendar year and have a specific status. 

 

I used the following formula which is of course wrong 🙂 Up to the part with the date I think I am right, I want to add the part that will only count bookings in the column "Status" it is either paid or confirmed.

 

Measure =
CALCULATE(
    DISTINCTCOUNT(
        Bookings[Booking number]),
        YEAR(Bookings[Check-out date] = 2023)
)
 
Wishing you a happy new year
1 ACCEPTED SOLUTION
Dangar332
Super User
Super User

Hi, @Samhunt 

try below

Measure =
CALCULATE(
    DISTINCTCOUNT(
        Bookings[Booking number]),
      filter(
        all(Bookings[Check-out date],Bookings[status]),
        YEAR(Bookings[Check-out date]) = 2023 &&
        Bookings[status] ="paid" || Bookings[status] ="confirmed"
      )
)

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Samhunt 

One more version:

Measure1 =
CALCULATE (
    DISTINCTCOUNT ( Bookings[Booking number] ),
    YEAR ( Bookings[Check-out date] ) = 2023,
    Bookings[status] IN { "Paid", "Confirmed" }
)

 




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Dangar332
Super User
Super User

Hi, @Samhunt 

try below

Measure =
CALCULATE(
    DISTINCTCOUNT(
        Bookings[Booking number]),
      filter(
        all(Bookings[Check-out date],Bookings[status]),
        YEAR(Bookings[Check-out date]) = 2023 &&
        Bookings[status] ="paid" || Bookings[status] ="confirmed"
      )
)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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