We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi there,
I'm desperately wanting to get this solved as I've been struggling to find a right way to get it solved.
I have a set of data with date, overtime hours, and team, and I'd like to pull a line graph with x-axis of timeline (month-year) and y-axis of OT hours. The graph is going to display all 3 teams' OT hours. However, the hours sum for each month is always based on the sum total from Jan 2023. Eg. for the total OT hours in May 2023, it'd be the total OT hrs from Jan 2023, Feb 2023, Mar, 2023, Apr 2023, and May 2023.
What's the best way to create such formula in dax?
sample data set:
| Date | OT Hours | Team |
| 1/1/2023 | 6 | A |
| 1/7/2023 | 4 | A |
| 1/18/2023 | 5 | B |
| 2/3/2023 | 7 | B |
| 2/28/2023 | 3 | A |
| 3/5/2023 | 6 | A |
| 3/29/2023 | 3 | B |
| 4/6/2023 | 5 | B |
| 4/15/2023 | 10 | A |
| 4/23/2023 | 12 | A |
| 4/28/2023 | 8 | B |
| 5/2/2023 | 13 | B |
| 5/6/2023 | 10 | A |
| 5/12 | 12 | A |
Thank you!
Gab
If you have a calendar table, you can compute the aggregation by using TOTALYTD (https://learn.microsoft.com/en-us/dax/totalytd-function-dax)
Measure = TOTALYTD(SUM(Table[OT Hours]),Calendar[Date])
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 17 | |
| 17 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 38 | |
| 34 | |
| 22 |