Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello !
Need help to find solution for cumulative number of days mont by month over the years.
For each year I am looking for days per month - will use it in other calculations
For each month in the year I am looking for cumulative number of days by month (sum month days)
How to get such a columns - see printscreen
Thanks a lot
Solved! Go to Solution.
I think I found solution and want to share with you
I think I found solution and want to share with you
It gives me only one date day back ???
What I don't understand
Here it is what I tried
@gvlado , For this first make sure you have one date table if not then create using below DAX
DateTable =
ADDCOLUMNS (
CALENDAR (DATE(2010, 1, 1), DATE(2025, 12, 31)),
"Year", YEAR([Date]),
"Month", MONTH([Date]),
"MonthName", FORMAT([Date], "MMMM"),
"Day", DAY([Date]),
"MonthYear", FORMAT([Date], "MMM YYYY")
)
Then create a new column in Date Table for number of days in each month
DaysInMonth =
DAY ( EOMONTH ( DateTable[Date], 0 ) )
Create a new column in the Date table to calculate the cumulative number of days by month:
CumulativeDays =
VAR CurrentYear = DateTable[Year]
Go to the Report view.
Click on the Table visualization icon to create a new table visualization.
Drag the following fields from the Date table to the Values area of the table visualization:
Year
MonthName
DaysInMonth
CumulativeDays
VAR CurrentMonth = DateTable[Month]
RETURN
CALCULATE (
SUM ( DateTable[DaysInMonth] ),
FILTER (
DateTable,
DateTable[Year] = CurrentYear &&
DateTable[Month] <= CurrentMonth
)
)
Proud to be a Super User! |
|
What I did wrong?
@gvlado , The issue was due to Granuality we need cummulative days at month level, I have created new summarized table for this attaching PBIX file with complete solution
Proud to be a Super User! |
|
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 74 | |
| 66 | |
| 65 |