Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I want to create a graph where my X axis has months of the year and my Y axis has count of items. The idea is to have the graph include all the months that the item has been hired, which is identified between a start and an end date.
For example, if an item has been on-hired January 2024 and off-hired March 2024, the graph will count 1 for January, February and March.
I have the idea in my head but I am struggling to execute. My data has [item], [start_date] and [end_date].
Thank you.
Solved! Go to Solution.
try to create a date table
Proud to be a Super User!
hi @alex9999 You can try below dax and let me know if it works
Items Count =
VAR MinDate = MIN('OnboardOffboardTable'[start_date])
VAR MaxDate = MAX('OnboardOffboardTable'[end_date])
VAR CalendarTable = CALENDAR(MIN(MinDate), MAX(MaxDate))
RETURN
SUMX(
CalendarTable,
CALCULATE(
COUNTROWS('OnboardOffboardTable'),
'OnboardOffboardTable'[start_date] <= CalendarTable[Date] &&
'OnboardOffboardTable'[end_date] >= CalendarTable[Date]
)
)
https://analyticpulse.blogspot.com
hi @alex9999 You can try below dax and let me know if it works
Items Count =
VAR MinDate = MIN('OnboardOffboardTable'[start_date])
VAR MaxDate = MAX('OnboardOffboardTable'[end_date])
VAR CalendarTable = CALENDAR(MIN(MinDate), MAX(MaxDate))
RETURN
SUMX(
CalendarTable,
CALCULATE(
COUNTROWS('OnboardOffboardTable'),
'OnboardOffboardTable'[start_date] <= CalendarTable[Date] &&
'OnboardOffboardTable'[end_date] >= CalendarTable[Date]
)
)
https://analyticpulse.blogspot.com
try to create a date table
Proud to be a Super User!
Perfect solution. I did attempt with other forum posts but this one made it very clear to me. Thank you!
you are welcome
Proud to be a Super User!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
78 | |
59 | |
36 | |
33 |
User | Count |
---|---|
94 | |
61 | |
56 | |
49 | |
41 |