Forum Discussion
Filter on the measure.
Now work out, is there any function I can subistituir the MAX function, because with the Max function I'll just have the value 2015 if I apply the 2015 filter the returned value will be blank
Anonymous - I don't understand what you are asking, you can substitute just about anything in there, even = 2015 if you want to hard code it.
- Sean10 years ago
Community Champion
This is why it's good to have a calendar table? I thought you have one?
you can then do Year to Date and Previous Year - which will adjust with the slicers
- Sean10 years ago
Community Champion
Anonymous These Measure give Year and Previous Year and Year on Year Change and Year On Year %
Add the Year Slicer and then select at least 2 consective years!
Max Year = CALCULATE([Total Net], FILTER(Payments, Payments[PMT Year]=MAX(Payments[PMT Year])))
Max Year -1 = CALCULATE([Total Net], FILTER(Payments, Payments[PMT Year]=MAX(Payments[PMT Year])-1))
YoY Change = [Max Year] - [Max Year -1]
YoY % Change = DiVIDE ( [YoY Change], [Max Year -1], 0)Let me know if you do decide to add a Caledar Table - there's a better way to do this.
- Sean10 years ago
Community Champion
Anonymous
2016 - ( 2016 - 1) => 1
FILTER (DMEGF_Ano; DMEGF_Ano [Year] = MAX (DMEGF_Ano [Year]) - (MAX (DMEGF_Ano [Year]) - 1)))
delete the underlined part
- Sean10 years ago
Community Champion
are you using DMEFG_Ano[Year] for the Slicer?
- Anonymous10 years agoNot applicable
The dates of tables I have are two, one that tells the year and one that informs the month both are relacionan through the fact table, just need to now see a way to use this as VOES passed me without the MAX function in time determine the year to calculate
- Greg_Deckler10 years ago
Community Champion
Anonymous - Could you just add a Year slicer to your report and by picking the Year from the slicer, that should filter the measure such that the MAX of year will always be the value of the selected year in slicer.
- Anonymous10 years agoNot applicable
I tried the following expression and the value is blank:
Consumption Warehouse 2 = calculate (sum (Facts [Vl_ConsumoAlmox]) - sum (Facts [Vl_EstornoAlmox]), FILTER (DMEGF_Ano; DMEGF_Ano [Year] = MAX (DMEGF_Ano [Year]) - MAX (DMEGF_Ano [Year]) - 1)) - Sean10 years ago
Community Champion
Anonymous what are you trying to calculate? for what year?
this is what your FILTER is doing => 2016 - 2016 - 1
thats why you are getting BLANK
- Greg_Deckler10 years ago
Community Champion
Consumption Warehouse 2 = calculate (sum (Facts [Vl_ConsumoAlmox]) - sum (Facts [Vl_EstornoAlmox]), FILTER (DMEGF_Ano; DMEGF_Ano [Year] = (MAX (DMEGF_Ano [Year]) - 1)))
- Anonymous10 years agoNot applicable
correct the error and the information is being displayed however when I do a filter annually whether in 2016, 2015 or 2014 values are blank
- Anonymous10 years agoNot applicable
yes, to correct that what you recommend? I create a dimenssão calendar?
- Sean10 years ago
Community Champion
Do you have any other filters/slicers ON at the same time?
EDIT:
If you want to create a Date Table look here (Link by Matt)
http://www.powerpivotpro.com/2015/02/create-a-custom-calendar-in-power-query/
- Anonymous10 years agoNot applicable
Yes, my reports have several filters
- Sean10 years ago
Community Champion
Anonymous I tried these formulas with several Slicers and it works.