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 teams
i have a report connected to PostgreSql using direct query, and i need to create a group based on difference between current time and admision date, comes out like in this visual.
and this is my data,
is anyone can help me to solved it?
thank you
Solved! Go to Solution.
sorry for late respond,
thanks for your help,
But i ran into another problem after implement your way
for workaround, i try creating query script with DATE_PART function in SQL editor
Thanks for your help btw.
Hi @Anonymous ,
Create a calculated column like this:
group_ = var days = ABS(DATEDIFF(Table_5[date1],Table_5[date2],HOUR))/24
return SWITCH(TRUE(),
0<days&&days<1,"<1 day",
1<days&&days<2,"1-2 days",
">2 days")
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
sorry for late respond,
thanks for your help,
But i ran into another problem after implement your way
for workaround, i try creating query script with DATE_PART function in SQL editor
Thanks for your help btw.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |