Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
Is there a way to show the total days, hours, minutes and seconds in a chosen month? I have a date table which is linked to my other tables.
E.g if i select November 2021,Total Days = 30, Total Hours = 720, Total Minutes = 43200, Total Seconds = 2592000
Thanks
Solved! Go to Solution.
Hi @yaman123 ,
Here are the steps you can follow:
1. Create measure.
Measure =
var _select=SELECTEDVALUE('Table'[Date])
var _startday=EOMONTH(_select,-1)
var _endday=ENDOFMONTH('Table'[Date])
var _day=
DATEDIFF(_startday,_endday,DAY)
var _hour=
DATEDIFF(_startday,_endday,HOUR)
var _minute=
DATEDIFF(_startday,_endday,MINUTE)
var _second=
DATEDIFF(_startday,_endday,SECOND)
return
_day&""&"Days" &" "& _hour&""&"Hours" &" "& _minute&""&"Minutes" &" "& _second&""&"Seconds"
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @yaman123 ,
Here are the steps you can follow:
1. Create measure.
Measure =
var _select=SELECTEDVALUE('Table'[Date])
var _startday=EOMONTH(_select,-1)
var _endday=ENDOFMONTH('Table'[Date])
var _day=
DATEDIFF(_startday,_endday,DAY)
var _hour=
DATEDIFF(_startday,_endday,HOUR)
var _minute=
DATEDIFF(_startday,_endday,MINUTE)
var _second=
DATEDIFF(_startday,_endday,SECOND)
return
_day&""&"Days" &" "& _hour&""&"Hours" &" "& _minute&""&"Minutes" &" "& _second&""&"Seconds"
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @yaman123 ,
Create a column for each with below code:-
Days:-
Days =
var dayy = EOMONTH(Days_calculation[Column1],0)
return DAY(dayy)
Hours:-
Hours = Days_calculation[Days] * 24
Minutes
Minutes = Days_calculation[Hours] * 60
Seconds = Days_calculation[Minutes] * 60
Now add month in a slicer and these columns in required visual you will get desired output.
Output:-
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
85 | |
66 | |
52 | |
47 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |