Forum Discussion
Graph output not showing Correct
- 5 years ago
Hi sakshikaul ,
In order to make the data output correct, I created a table to store the 12 months from January to December. Associate it with the month column of the DBALLSTAT table, and set the filtering direction to single. Then modify the measure:
previous year = var Selectvalue = CALCULATE( [SelectYear], FILTER( ALL('DBALLSTAT'), 'DBALLSTAT'[Eco_year] = MAX('DBALLSTAT'[Eco_year])-1 && DBALLSTAT[Month] = MAX(DBALLSTAT[Month]) ) ) var notselect = CALCULATE( [SelectYear], FILTER( ALL('DBALLSTAT'), 'DBALLSTAT'[Eco_year] = MAXX(ALL(DBALLSTAT),'DBALLSTAT'[Eco_year])-1 && DBALLSTAT[Month] = MAX('Month'[Column1]) ) ) return IF( ISERROR(ALLSELECTED(DBALLSTAT[Eco_year])), notselect, IF( ALLSELECTED('DBALLSTAT'[Eco_year])=2021, notselect, Selectvalue ) )In my sample data, I have successfully fulfilled your requirements, please check the PBIX file for more details.
Hi sakshikaul ,
Modify the measure:
previous year =
var Selectvalue =
CALCULATE(
[SelectYear],
FILTER(
ALL('DBALLSTAT'),
'DBALLSTAT'[Eco_year] = MAX('DBALLSTAT'[Eco_year])
&& DBALLSTAT[Month] = MAX(DBALLSTAT[Month])
)
)
var notselect =
CALCULATE(
[SelectYear],
FILTER(
ALL('DBALLSTAT'),
'DBALLSTAT'[Eco_year] = MAXX(ALL(DBALLSTAT),'DBALLSTAT'[Eco_year])-1
&& DBALLSTAT[Month] = MAX(DBALLSTAT[Month])
)
)
return IF(ISFILTERED('DBALLSTAT'[Eco_year]),Selectvalue,notselect)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
HI,
It is working fine if I am selecting year as 2021 but its again not working correctly if I am selecting year=2020
Here I am not getting previous year comparison. Previous year comparison is only functinable if I select year =2021
So Now i want if I select year =2021 then the data for 2021 and 2020 should be available
simmilarly if I select year=2020 then the data for 2020 and 2019 should be available on the graph as so on....