Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
We have a business unit that wants us to create a report that aggregates a number of fields, including a couple of milestone dates. In the excel version of the report that we are basing it from, they just take the average of the dates to show on the aggregate row. I tried doing the following, but it returns as an Number, which Power BI does not allow you to format as a date:
AVG SC = AVERAGEA('DBOP Pipeline'[SC])
If I put "DATEVALUE()" around the number, it throws an error.
Solved! Go to Solution.
I figured out how to get around the formatting problem, it's pretty dumb:
AVG SC = FIRSTDATE('DBOP Pipeline'[SC])+ INT(AVERAGEA('DBOP Pipeline'[SC]) - FIRSTDATE('DBOP Pipeline'[SC]))
Also, I figured out this method for finding the "middle" date:
MID SC = FIRSTDATE('DBOP Pipeline'[SC])+ INT( DATEDIFF(FIRSTDATE('DBOP Pipeline'[SC]),LASTDATE('DBOP Pipeline'[SC]),DAY)/2)
I figured out how to get around the formatting problem, it's pretty dumb:
AVG SC = FIRSTDATE('DBOP Pipeline'[SC])+ INT(AVERAGEA('DBOP Pipeline'[SC]) - FIRSTDATE('DBOP Pipeline'[SC]))
Also, I figured out this method for finding the "middle" date:
MID SC = FIRSTDATE('DBOP Pipeline'[SC])+ INT( DATEDIFF(FIRSTDATE('DBOP Pipeline'[SC]),LASTDATE('DBOP Pipeline'[SC]),DAY)/2)
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
39 | |
27 | |
21 | |
21 | |
10 |
User | Count |
---|---|
44 | |
36 | |
35 | |
19 | |
15 |