Forum Discussion
Bar chart visualization for different years
- 4 years ago
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] )
)
- Anonymous4 years agoNot applicable
- Anonymous4 years agoNot applicable
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!