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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
miinseon
Helper I
Helper I

table with more than one date column

Hi all 🙂


I want to ask a question about a table with more than one date column


My table has more than one date column.
I want to get a measure for each date column.
For example, if I have a reserve date and a payment date, I want to get a measure for the number of bookings and the amount paid in one screen.

 

I've included some data from the table below and an example of the screen I'd like to display.

 

I hope you can help me.
Thanks in advance

miinseon_0-1720163423852.pngmiinseon_1-1720163581193.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @miinseon ,

 

Your solution is great, @bhanu_gautam . Here I have another idea in mind, and I would like to share it for reference.

 

As per your question, I have created simple data :

 

vlinhuizhmsft_1-1720175742807.png

 

 

vlinhuizhmsft_1-1720175443367.png

 

Since you need to get the amount paid one day after the reserve date, we use the following function:

 

 

 

 

Measure 2 =

VAR _date = SELECTEDVALUE('DAX DateTable'[Date]) + 1

VAR _sum = CALCULATE(SUM('Table'[price]),FILTER(ALL('Table'),'Table'[payment_date] = _date && 'Table'[reserve_date] = SELECTEDVALUE('DAX DateTable'[Date])))

RETURN

_sum

 

 

 

 

The final results are as follows:

 

vlinhuizhmsft_2-1720176043831.png

 

 

If you have any other questions please feel free to contact me.

 

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

 

View solution in original post

3 REPLIES 3
mark_endicott
Super User
Super User

@miinseon - To build on the idea from @bhanu_gautam you can also do this with one date table. 

 

Create base measures:

 

CountBookings = COUNTROWS('Bookings')

TotalAmount = SUM('Bookings'[AmountPaid])

 

Then create measures that reference these, but change the context of their calculation by date:

 

CountBookingsByReserveDate = CALCULATE( [CountBookings], USERELATIONSHIP( 'Bookings'[Reserve Date], 'Calendar_table'[Date]))
TotalAmountPaidByReserveDate = CALCULATE( [TotalAmountPaid], USERELATIONSHIP( 'Bookings'[Reserve Date], 'Calendar_table'[Date]))
 
CountBookingsByPaymentDate = CALCULATE( [CountBookings], USERELATIONSHIP( 'Bookings'[Payment Date], 'Calendar_table'[Date]))
TotalAmountPaidByPaymentDate = CALCULATE( [TotalAmountPaid], USERELATIONSHIP( 'Bookings'[Payment Date], 'Calendar_table'[Date]))

 

Finally these measures will only work once you have created 2 "In-active" relationships from the Calendar table to the respective dates in the Bookings table. Very important to make sure they are both In-active. 

 

If this works for you, please mark as the solution. 

Anonymous
Not applicable

Hi @miinseon ,

 

Your solution is great, @bhanu_gautam . Here I have another idea in mind, and I would like to share it for reference.

 

As per your question, I have created simple data :

 

vlinhuizhmsft_1-1720175742807.png

 

 

vlinhuizhmsft_1-1720175443367.png

 

Since you need to get the amount paid one day after the reserve date, we use the following function:

 

 

 

 

Measure 2 =

VAR _date = SELECTEDVALUE('DAX DateTable'[Date]) + 1

VAR _sum = CALCULATE(SUM('Table'[price]),FILTER(ALL('Table'),'Table'[payment_date] = _date && 'Table'[reserve_date] = SELECTEDVALUE('DAX DateTable'[Date])))

RETURN

_sum

 

 

 

 

The final results are as follows:

 

vlinhuizhmsft_2-1720176043831.png

 

 

If you have any other questions please feel free to contact me.

 

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

 

bhanu_gautam
Super User
Super User

@miinseon , You can achieve this using Measure and date table

 

First create measures
CountBookingsByReserveDate = COUNTROWS('Bookings')

 

TotalAmountPaidByPaymentDate = SUM('Bookings'[AmountPaid])

 

Then create a date table for reserve date go to modelling and new table

ReserveDateTable = CALENDAR(MIN('Bookings'[ReserveDate]), MAX('Bookings'[ReserveDate]))

Similarly new table for Payment

 

PaymentDateTable = CALENDAR(MIN('Bookings'[PaymentDate]), MAX('Bookings'[PaymentDate]))

 

Create a relationship between Bookings[ReserveDate] and ReserveDateTable[Date].

Create a relationship between Bookings[PaymentDate] and PaymentDateTable[Date].

 

Then create visualizations




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors