March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi all,
I'm pretty new to power bi so I would like some help on this
I am trying to calculate the month difference between the max date and the selected date
I tried 2 different methods:
Method 1 using today() and it worked well
Solved! Go to Solution.
Hi @darlingling520 ,
You could try this:-
datediff2 =
var max_date = calculate(max(DATA[date]),ALL(DATA[date]))
return DATEDIFF(SELECTEDVALUE(DATA[date]),max_date,MONTH)
BR,
Samarth
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
okay I already figured out myself - in order to use the max function
i need to use maxdate= calculate(max(data[date]),all(data)); so the max date will be fixed and therefore i can use it to calculate the datediff
okay I already figured out myself - in order to use the max function
i need to use maxdate= calculate(max(data[date]),all(data)); so the max date will be fixed and therefore i can use it to calculate the datediff
Hi @darlingling520 ,
You could try this:-
datediff2 =
var max_date = calculate(max(DATA[date]),ALL(DATA[date]))
return DATEDIFF(SELECTEDVALUE(DATA[date]),max_date,MONTH)
BR,
Samarth
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
thanks so much!!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
164 | |
116 | |
63 | |
57 | |
50 |