Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi
I have direct query dataset of about 3000 rows. One of the rows contains an int-value of seconds.
In PBI I have made a measure which is just MAX(table[DurationInSecs]), but I've set this to be Dynamic format and in the format I have made this:
Solved! Go to Solution.
However, you're suggestion gave me a better/more efficient code for the RETURN statement.
Changed my DAX to the following and the results good and the speed is much better.
Thanks a lot 🙂
Regards,
Mads
HI @MadBern85 ,
You can try to use the following expressions if helps:
format =
VAR _vTS = SELECTEDMEASURE()
VAR _vDays =
INT ( DIVIDE ( _vTS, 86400, 0 ) )
VAR _vHours =
INT ( DIVIDE ( _vTS - _vDays * 86400, 3600, 0 ) )
VAR _vMins =
INT ( DIVIDE ( _vTS - _vDays * 86400 - _vHours * 3600, 60 ) )
VAR _vSecs = _vTS - _vDays * 86400 - _vHours * 3600 - _vMins * 60
RETURN
IF ( _vTS > 86400, _vDays & "d " )
& IF ( _vTS > 3600, _vHours & "h " )
& IF ( _vTS > 60, _vMins & "m " ) & _vSecs & "s"
Regards,
Xiaoxin Sheng
Hi
Thanks for the suggestion, this is quite close to something I've already tried and the speed is much improved, but it produces some errors. Which I haven't been able to correct.
Regards,
Mads
However, you're suggestion gave me a better/more efficient code for the RETURN statement.
Changed my DAX to the following and the results good and the speed is much better.
Thanks a lot 🙂
Regards,
Mads
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 70 | |
| 39 | |
| 35 | |
| 23 |