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
I am using DATEIFF function to create calculated column to calculate time interval between two days. May I ask if you can help me how can I calculate half a year intervals? The function only allows me for Quarters.
I would appreciate any other suggestions on how to calculate the column.
Function I am using:
Solved! Go to Solution.
Hi @AndreaSo ,
For this you just need to take the value and multiply or divide by the corresponding values so if you use the year has parameter in datediff multipli by 2, if it's quarters divide by 2, if its months divide by 6. you measure should be similar to this:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @AndreaSo ,
For this you just need to take the value and multiply or divide by the corresponding values so if you use the year has parameter in datediff multipli by 2, if it's quarters divide by 2, if its months divide by 6. you measure should be similar to this:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @AndreaSo ,
You can use MONTH as an interval. For example:-
EVALUATE VAR StartDate = DATE ( 2019, 07, 01 ) VAR EndDate = DATE ( 2021, 12, 31 ) RETURN { ( "Year", DATEDIFF ( StartDate, EndDate, YEAR ) ), ( "Quarter", DATEDIFF ( StartDate, EndDate, QUARTER ) ), ( "Month", DATEDIFF ( StartDate, EndDate, MONTH ) ), ( "Week", DATEDIFF ( StartDate, EndDate, WEEK ) ), ( "Day", DATEDIFF ( StartDate, EndDate, DAY ) ) }
Datediff give you these interval options :-
- SECOND
- MINUTE
- HOUR
- DAY
- WEEK
- MONTH
- QUARTER
- YEAR
You can refer to this link for more information :-
https://learn.microsoft.com/en-us/dax/datediff-function-dax
Thanks,
Pratyasha Samal
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
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
113 | |
82 | |
45 | |
42 | |
28 |
User | Count |
---|---|
182 | |
82 | |
71 | |
48 | |
45 |