Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Show the number of travellers in KPI card who appeared more than once with same checkin and checkout dates?
Example:
from the above, count should 2.
ABC & BCD as the both passengers have same CheckIn date with different accomodations.
Can someone please help me achieveing the requirment above?
Solved! Go to Solution.
Hi @thupald ,
Try formula like below:
result =
VAR _row1 =
CALCULATE (
COUNTROWS ( 'Table' ),
ALLEXCEPT (
'Table',
'Table'[Passenger Name],
'Table'[CheckIn Date],
'Table'[Checkout Date]
)
)
VAR _row2 =
IF (
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALL ( 'Table' ),
'Table'[Passenger Name] = MAX ( 'Table'[Passenger Name] )
&& 'Table'[Name] = MAX ( 'Table'[Name] )
)
) = 0,
0,
1
)
RETURN
IF ( _row1 = 2 & _row2 = 0, COUNTROWS ( 'Table' ) )
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @thupald ,
Try formula like below:
result =
VAR _row1 =
CALCULATE (
COUNTROWS ( 'Table' ),
ALLEXCEPT (
'Table',
'Table'[Passenger Name],
'Table'[CheckIn Date],
'Table'[Checkout Date]
)
)
VAR _row2 =
IF (
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALL ( 'Table' ),
'Table'[Passenger Name] = MAX ( 'Table'[Passenger Name] )
&& 'Table'[Name] = MAX ( 'Table'[Name] )
)
) = 0,
0,
1
)
RETURN
IF ( _row1 = 2 & _row2 = 0, COUNTROWS ( 'Table' ) )
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@thupald try this measure
SUMX (
SUMMARIZE ( Table, Table[CheckInDate], Table[CheckOutDate], "@Cnt", DISTINCTCOUNT ( Table[PassengerName] ) ),
[@Cnt]
)
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Double Bookings =
SUMX(
FILTER(
SUMMARIZE(
Bookings,
Bookings[CheckIn Date],
Bookings[CheckOut Date],
Bookings[Passenger Name],
"@Cnt",
DISTINCTCOUNT(Bookings[Accomodation Name]) - 1
),
[@Cnt] > 0
),
[@Cnt]
)
Hi
Thankyou for the quick response, Its not giving the expected result, is there any otherway which can implement the same
I'm not sure what you mean by an unexpected result. Please explain.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
90 | |
89 | |
79 | |
70 | |
68 |
User | Count |
---|---|
226 | |
129 | |
120 | |
84 | |
78 |