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!
I believe there should be a rather easy solution for this, but for some reason, I haven't been able to do this
I have a list of products with the launching year and the year they will be discontinued.
I want a bar chart where my horizontal axis is the timeframe and the data being the count of products that will be launched (in one bar) and the products that will be discontinued in another bar.
| Product | Launched | Discontinued |
| Socks | 2021 | 2023 |
| Blouse | 2009 | 2021 |
| Pants | 2020 | 2021 |
| Jacket | 2019 | 2040 |
| Hairband | 2020 | 2022 |
| T-shirt | 2020 | 2024 |
| Gloves | 2008 | 2009 |
Does anyone have an idea on how to do this bar chart visualization?
It will be much appreciated!
Solved! Go to Solution.
You'll need a new table to use for the x-axis.
For example:
Years =
SELECTCOLUMNS (
GENERATESERIES ( MIN ( Products[Launched] ), MAX ( Products[Discontinued] ) ),
"Year", [Value]
)
This is just a list of years between 2008 and 2040.
Put Years[Year] on the x-axis and define your counting measures.
LaunchedCount =
CALCULATE (
COUNTROWS ( Products ),
Products[Launched] IN VALUES ( Years[Year] )
)
DiscontinuedCount =
CALCULATE (
COUNTROWS ( Products ),
Products[Discontinued] IN VALUES ( Years[Year] )
)
You'll need a new table to use for the x-axis.
For example:
Years =
SELECTCOLUMNS (
GENERATESERIES ( MIN ( Products[Launched] ), MAX ( Products[Discontinued] ) ),
"Year", [Value]
)
This is just a list of years between 2008 and 2040.
Put Years[Year] on the x-axis and define your counting measures.
LaunchedCount =
CALCULATE (
COUNTROWS ( Products ),
Products[Launched] IN VALUES ( Years[Year] )
)
DiscontinuedCount =
CALCULATE (
COUNTROWS ( Products ),
Products[Discontinued] IN VALUES ( Years[Year] )
)
Hi @AlexisOlson, a quick follow-up question on this.
How can I create a measure of "active" products per year?
Something like the summing the total number of launched products from previous years that haven't been discontinued, and substracting the discontinued per year.
Do I have to create a measure for each year? Or could I have a general one and then add a yearly slicer to my page?
Any tip will be appreciated!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |