dynamic data selection based on date
3 TopicsDate Range based on Slicer selection
Hello - I'm looking to return a list of the previous "X" days based on a selected day from a slicer. For example, once a day is selected in the 'Date' slicer, I want to return the date range in the visualization for the previous 180 days up to the selected day. In simple words, the logic would be something like the below, but I cannot make it work: IF ( Date >= SELECTEDVALUE ( Date )-180 || Date <= SELECTEDVALUE ( Date ) , Date , blank() ) And then use 'Date' in the visualization and exclude blanks. Any recommendation is more than welcome, thanks!!Solved1.9KViews0likes6CommentsDynamic calculation based on date slicer
I would like to perform a calculation which involves getting value from previous date. Also if the user selects a date value, I want to dynamically set the first value in that table to be set to a base formula. Formula is as follows. For the first date value my formula should as follows: 1*(1Value) For subsequent dates it should = Previous_value*(1+Value) Here is a sample dataset category region Year Month Date Value Apples West 2018 January January 2018 0.09 Apples West 2018 February February 2018 0.09 Apples West 2018 March March 2018 0.06 Apples West 2018 April April 2018 0.08 Apples West 2018 May May 2018 0.21 Apples West 2018 June June 2018 0.09 Apples West 2018 July July 2018 0.23 Apples West 2018 August August 2018 0.01 Apples West 2018 September September 2018 0.04 Apples West 2018 October October 2018 0.2 Apples West 2018 November November 2018 0.01 Apples West 2018 December December 2018 0.14 Apples West 2019 January January 2019 0.24 Apples West 2019 February February 2019 0.08 Apples West 2019 March March 2019 0.04 Apples West 2019 April April 2019 0.18 Apples West 2019 May May 2019 0.04 Apples West 2019 June June 2019 0.08 Apples West 2019 July July 2019 0.23 Apples West 2019 August August 2019 0.21 Apples West 2019 September September 2019 0.25 Apples West 2019 October October 2019 0.25 Apples West 2019 November November 2019 0.05 Apples West 2019 December December 2019 0.25 If the user selects the start date as March 2019 using slicers. My desired output should be as follows March 2019 the output column = 1*(1+0.04) = 1.04 April 2019 the output column = 1.04(from march output) *(1+0.18) = 1.23 May 2019 = 1.23(from April 2019) * (1+0.04) = 1.28 Then table output should be as follows category region Year Month Date Value Output Apples West 2019 March March 2019 0.04 1.04 Apples West 2019 April April 2019 0.18 1.23 Apples West 2019 May May 2019 0.04 1.28 Apples West 2019 June June 2019 0.08 1.38 Apples West 2019 July July 2019 0.23 1.70 Apples West 2019 August August 2019 0.21 2.05 Apples West 2019 September September 2019 0.25 2.56 Apples West 2019 October October 2019 0.25 3.21 Apples West 2019 November November 2019 0.05 3.37 Apples West 2019 December December 2019 0.25 4.21 Here are the measure that I tried to. It is unable to identify the previous month data get_minimum_date = VAR Minimun_Date = CALCULATE ( min('date'[Date]) ) Return VAR Date_to_Compare = CALCULATE(MIN ( 'date'[Date] ),ALLSELECTED()) RETURN var this_month_data = CALCULATE(Sum(data_v3[Value])) RETURN var value_returned = IF ( Date_to_Compare = Minimun_Date, 0, this_month_data ) return value_returned Using the get_minimum_date measure I tried to do the following measure prvious_date_cal = CALCULATE([get_minimum_date], PREVIOUSMONTH('date'[Date])) However my previous month function is not working and is causing errors Thanks in advanceSolved2.2KViews0likes6CommentsDynamic Filter on page
Hi all, I have a table that has the following columns: Customer SalesManager State Date ShipmentCount PriceCheckCount Where the Price Check Count is simply the amount of times a customer checks for a price but don't ship the product, and the Sales Manager is the employee responsable for that customer. So in the report I have a date range, and 3 tables. The first table is aggregating all the counts at the SalesManager level, the second one at the Customer level and the last one at the State level (just in case, these 3 tables are just visuals showing data at different levels, but the data in the model is comming from one table as I mentioned above). What I want to show in this report is the data for all the customers that, in the selected time range, the PriceCheckCount > ShipmentCount. This condition cannot be resolved by adding a column in the table cause it needs to change dynamically based on the date range. So I created a measure called deviation to show the difference between ShipmentCount and PriceCheckCount, and I'm filtering the second table (Customer level) where that measure is negative. Now I need to filter the other 2 tables based on the set of customers that I have as a result in the second table. I cannot use the same measure here because that will calculate the difference at the Employee and State level, and that result is not the same as filtering Employee and State counts based the set of customers where the total amount of PriceCheckCount > ShipmentCount in the selected time range. Does anybody have an idea of how I can achieve that? Thanks a lot.1.2KViews0likes1Comment