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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hello,
I want to create a measure that calculates avg session duration and attach "min" or "sec" word with it based on following condition
Solved! Go to Solution.
Avg. Session Duration = if(AVERAGE(driviology2[ga:avgSessionDuration])/60 >= 1 , AVERAGE(driviology2[ga:avgSessionDuration])/60 & " mins" ,SUM(driviology2[ga:avgSessionDuration]) & " secs")
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Avg. Session Duration = if(AVERAGE(driviology2[ga:avgSessionDuration])/60 >= 1 , AVERAGE(driviology2[ga:avgSessionDuration])/60 & " mins" ,SUM(driviology2[ga:avgSessionDuration]) & " secs")
@usmanrafiq
I am not sure what your column driviology2[ga:avgSessionDuration] returns, is t seconds or Minutes ?
Wrap with FORMAT ([Measure],"General") & "Min"
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 57 | |
| 52 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 112 | |
| 108 | |
| 39 | |
| 34 | |
| 27 |