Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi everyone,
I was just wondering if anyone can advise the best/efficient way to calculate frequency based on continuous dates and record id.
Scenario
Business Logic
SELECT [Customer ID]
,[CheckinDate]
,[CheckOutDate]
,[TotalDaysInHotel]
,[Customer type ]---This is alias table and is what we're trying to calculate(Frequency)
FROM [Dev].[dbo].[Customer]
WHERE [Customer ID] = '1'
Anything else with earlier, [CheckOutDate] than, [CheckinDate] is Data Quality issue as is not logically possible
I have attached the final results with Alias column [Customer type ] which is a result of above business logic
Many thanks for your help in advance.
HI @mydatastories,
If you can please share some sample data/pbix file (it should has same structure as original file) and expected result to help us clarify your requirement and test to coding formula.
Regards,
Xiaoxin Sheng
Hi everyone,
I was just wondering if anyone can advise the best/efficient way to calculate frequency based on continuous dates and record id.
Scenario
Business Logic
SELECT [Customer ID]
,[CheckinDate]
,[CheckOutDate]
,[TotalDaysInHotel]
FROM [Dev].[dbo].[Customer]
Anything else with earlier ,[CheckOutDate]than ,[CheckinDate] is Data Quality issue as is not logically possible
I have attached the final results with Alias column [Customer type ] which is a result of above business logic
Many thanks for your help in advance.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 61 | |
| 43 | |
| 40 | |
| 38 | |
| 22 |
| User | Count |
|---|---|
| 178 | |
| 125 | |
| 116 | |
| 77 | |
| 54 |