Forum Discussion
SAMEPERIODLASTYEAR with filters
Hi Kr1s ,
There is already an existing thread for this:
https://community.powerbi.com/t5/Desktop/SAMEPERIODLASTYEAR-with-filter/m-p/604118
If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂
Thanks,
Pragati
Hi Pragati11,
I saw that but it shows only 1 filter whereas i need 4. Also I need the calculation to read what the product is as we have over 200 so I can't hard code it all into the filter.
Thanks,
Kristian
- Pragati116 years ago
Super User
- Kr1s6 years agoFrequent Visitor
- Pragati116 years ago
Super User
Hi Kr1s ,
In the following link I see a way to use SAMEPERIODLASTYEAR dax function with multiple filters.
https://community.powerbi.com/t5/Desktop/DAX-SAMEPERIODLASTYEAR-Filter/td-p/92084
In the above link you see a dax calculation using 2 filters with && operator:
Measure = CALCULATE ( DISTINCTCOUNT ( Sales[DocumentNumber] ); FILTER ( ALL ( Sales ); Sales[Field1] = "1" && Sales[Field2] = VALUE ( 1 ) ); SAMEPERIODLASTYEAR ( Dates[Date] ) )You can try something similar to add more filters here.
If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂
Thanks,
Pragati