The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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
User | Count |
---|---|
68 | |
63 | |
59 | |
54 | |
28 |
User | Count |
---|---|
183 | |
80 | |
62 | |
46 | |
38 |