Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi Everyone!
I do have a problem with creating a proper DAX measure.
I have created DAX calendar, where relationship to my Manager Raitings tab is done.
Based on that calendar i extracted Quarter and Year indicator, which is a filter on my canvas.
I do also have a separate period filter which indicates 3 mths ago, 1 year ago, 3 years ago...
Now, i need to count how many managers where marked as buy, hold or sell in given time period (e.g 3 mnths ago, 1 year ago, 3 years ago) based on quarter and year choosen in the slicer on canvas.
So, e.g if i date slice i choose Q2 2019, and in the period slicer i choose 3mths ago i want to know how managers where classified in Q1 2019.
I have created below measure: ( that one is an 3mths example, but i used the same pattern for 1 year, 3yrs, etc...
and just know i realized that it counts everything based on TODAY date, not date choosen on canvas slicer.
Could you please help me and let me know how TODAY should be replaced in the measure, so that it takes into considiration date choosen on the page ?
Below is example of my calendar tab if needed:
Date | Month | MonthOrder | Quarter | Quarter + Year | Year | PrevQDate | PrevQ | Eoq |
23-Apr-15 | Apr | 4 | Q2 | Q2 2015 | 2015 | 23-Jan-15 | Q1 2015 | 30 June 2015 |
24-Apr-15 | Apr | 4 | Q2 | Q2 2015 | 2015 | 24-Jan-15 | Q1 2015 | 30 June 2015 |
25-Apr-15 | Apr | 4 | Q2 | Q2 2015 | 2015 | 25-Jan-15 | Q1 2015 | 30 June 2015 |
26-Apr-15 | Apr | 4 | Q2 | Q2 2015 | 2015 | 26-Jan-15 | Q1 2015 | 30 June 2015 |
27-Apr-15 | Apr | 4 | Q2 | Q2 2015 | 2015 | 27-Jan-15 | Q1 2015 | 30 June 2015 |
28-Apr-15 | Apr | 4 | Q2 | Q2 2015 | 2015 | 28-Jan-15 | Q1 2015 | 30 June 2015 |
29-Apr-15 | Apr | 4 | Q2 | Q2 2015 | 2015 | 29-Jan-15 | Q1 2015 | 30 June 2015 |
30-Apr-15 | Apr | 4 | Q2 | Q2 2015 | 2015 | 30-Jan-15 | Q1 2015 | 30 June 2015 |
1-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 1-Feb-15 | Q1 2015 | 30 June 2015 |
2-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 2-Feb-15 | Q1 2015 | 30 June 2015 |
3-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 3-Feb-15 | Q1 2015 | 30 June 2015 |
4-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 4-Feb-15 | Q1 2015 | 30 June 2015 |
5-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 5-Feb-15 | Q1 2015 | 30 June 2015 |
6-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 6-Feb-15 | Q1 2015 | 30 June 2015 |
7-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 7-Feb-15 | Q1 2015 | 30 June 2015 |
8-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 8-Feb-15 | Q1 2015 | 30 June 2015 |
9-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 9-Feb-15 | Q1 2015 | 30 June 2015 |
10-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 10-Feb-15 | Q1 2015 | 30 June 2015 |
11-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 11-Feb-15 | Q1 2015 | 30 June 2015 |
12-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 12-Feb-15 | Q1 2015 | 30 June 2015 |
13-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 13-Feb-15 | Q1 2015 | 30 June 2015 |
14-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 14-Feb-15 | Q1 2015 | 30 June 2015 |
15-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 15-Feb-15 | Q1 2015 | 30 June 2015 |
16-May-15 | May | 5 | Q2 | Q2 2015 | 2015 | 16-Feb-15 | Q1 2015 | 30 June 2015 |
Thanks in advance!
Solved! Go to Solution.
Hi @Kopek
Try something like this:
3Mth = calculate(COUNT('Manager Ratings'[Status]),DATESINPERIOD('Calendar'[Date],max('Calendar'[Date]),-3,MONTH))
if not help, please kindly share yor dummy pbix.
Hi @Kopek
Try something like this:
3Mth = calculate(COUNT('Manager Ratings'[Status]),DATESINPERIOD('Calendar'[Date],max('Calendar'[Date]),-3,MONTH))
if not help, please kindly share yor dummy pbix.
@Kopek , for rolling try like
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-12,MONTH))
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],max(Sales[Sales Date]),-12,MONTH))
Rolling 12 till last 12 month = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(dateadd(Sales[Sales Date],-12,month)),-12,MONTH))
Rolling 3= CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],staroffmonth(Sales[Sales Date]),3,MONTH))
Rolling 7 days = CALCULATE(sum(Sal[Sales Amount]),DATESINPERIOD('Date'[Date],max(Sales[Sales Date]),-7,Day))
User | Count |
---|---|
128 | |
108 | |
100 | |
64 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |