Forum Discussion
Anonymous
5 years agoNot applicable
Animated line chart show only one value
Dear friend I tried to use the "Play Axis" visual , it should display progressive with historical data but it only displays one value at a time. how can I fix it? what I need
- 5 years ago
Hi Anonymous ,
Create a disconnected table with the values of your play axis and then add the following measure to your line chart and use the new table to the Axis:
TotalSales = IF ( SELECTEDVALUE ( 'YearPlayAxisTable'[Year] ) >= MAX ( 'Table'[Year] ), SUM ( 'Table'[Value] ), IF ( COUNTROWS ( ALL ( 'YearPlayAxisTable'[Year] ) ) <= COUNTROWS ( ALLSELECTED ( 'YearPlayAxisTable'[Year] ) ), SUM ( 'Table'[Value] ) ) )If you want to keep the chart with all the year shown enter a measure like this:
FlatLine = 0For this line set the line size has 0 and the data labels off
Result below and in attach PBIX file:
If you want you can change the flat line by another value to get it more dinamic and don't set the y-axis maximum and minimum.
MFelix
Super User
3 years agoAno_Mês = format(EJEMPLO[Fecha], "YYYY-MMM")
Sort = FORMAT(EJEMPLO[Fecha], "YYYYMM")
Use the following syntax to create the YearPlayaxis table
YearPlayAxisTable = FILTER(SUMMARIZE(EJEMPLO, EJEMPLO[Año], EJEMPLO[Mes], "Date", MAX(EJEMPLO[Fecha])), EJEMPLO[Año] <> BLANK())
Change you calculation to:
TotalSales =
IF (
SELECTEDVALUE ( YearPlayAxisTable[Date] ) >= MAX ( EJEMPLO[Fecha] ),
SUM ( EJEMPLO[Ctd.en UM entrada] ),
IF (
COUNTROWS ( ALL ( YearPlayAxisTable[Date] ) )
<= COUNTROWS ( ALLSELECTED ( 'YearPlayAxisTable'[Date] ) ),
SUM ( EJEMPLO[Ctd.en UM entrada] )
)
)
Result below:
Hi Crosales ,
Add two columns to your model Year-Month and Sort
Syndicate_Admin
Administrator
3 years agoThanks a lot!