Forum Discussion
DAX selected years
- 3 years ago
Hello
after a lot of struggle i found the solution to my problem
basically I had to create several calendars and use the formula CALCULATE([Year Value],USERELATIONSHIP('Calendar Year 1'[Date],Sales[Date])) for each selected year
it Works very well
send the example for knowledge
EXEMPLEThank you all for your help
good evening
thanks for the answers
in the end I need to compare the values of the years that the user has chosen, that is, compare 2022 with 2020 and 2020 with 2014 (example)
I have to find a way to find out which years the user has chosen and compare them
I appreciate all the help you can give me
thanksRead about using the FILTERS() function.
- ngomes3 years agoHelper II
thanks ibendlin
I read a lot about filters with dax but I'm still having difficulties comparing the year 2022 with 2020 and 2020 with 2014 for example
I have slicer per year and as I said at the beginning the user can choose any slicer year
- lbendlin3 years agoSuper User
I didn't say filters, I said "the FILTERS() function". These are slightly different things. The FILTERS () function allows you to retrieve the currently selected values of a column, and to then create computations in DAX with them.
Please provide sanitized sample data that fully covers your issue.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523