variable not working in condition
1 TopicUnable to use SELECTEDVALUE variable in DAX calculations
Hi, I have a DAX calculation where I use a slectedvalue() from a month slicer. If I just return the selectedvalue() itself, it returns the selected month from slicer, but when I try to use this selectedvalue in a DAX condition, it never works. My Data: 1. Calendar Table : 2. Sales Table: What I Want: Sum the sales for each month , but only upto the selected month (in month slicer). For example if I select February, I should see total sales of January and February only. My current DAX Code : Sales by Selected Month = VAR SelectedMonth = SLECTEDVALUE('Calendar'[date].[Month]) RETURN CALCULATE( SUM('Table'[Sales(USD)]), FILTER( 'Table', 'Table'[date].[Month] <= SelectedMonth ) ) In the above Dax code, in the calculate function instead of using SlectedMonth variable, if I use a static month number like 2, it works but when I use the variable it returns the sum of sales for the whole year. @allSolved1.3KViews0likes3Comments