The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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)
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
52 | |
22 | |
11 | |
11 | |
9 |
User | Count |
---|---|
112 | |
32 | |
30 | |
20 | |
19 |