Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everybody, i need your help with dax:
i have a one year data with weekly Analysis Date. So it's a historical data weekly backed up. Each analysis date is the first day of the week.
-i need to count how many persons with Status="green" were there in the last 10 weeks in each Analysis Date.
so today: go back of 10 weeks and count how many persons had Status="ok" in the period today and minus 10 weeks
17 of june: go back of 10 weeks and count how many persons had Status="ok" in the period 17 june and minus 10 weeks
i want to have this information per each analysis date. So not exactly 10 weeks ago, but in all the Analysis Dates between 10 weeks ago and the Analysis date
Any suggestion ?
Columns:
ANALYSIS DATE(each monday of the week;, PERSON(id of person); STATUS(red, green,amber)
Solved! Go to Solution.
@Giavo,
Create a new table using dax below.
Table = CALCULATETABLE(YourTable,YourTable[STATUS]="green")
Then in the new table, create the following column and measure.
Column = DATE(YEAR('Table'[ANALYSIS DATE]),MONTH('Table'[ANALYSIS DATE]),DAY('Table'[ANALYSIS DATE])-70)
Measure = CALCULATE(COUNTA('Table'[PERSON]),DATESBETWEEN('Table'[ANALYSIS DATE],MAX('Table'[Column]),MAX('Table'[ANALYSIS DATE])))
At last, create a table visual using date field and measure of the new table.
Regards,
Lydia
@Giavo,
Create a new table using dax below.
Table = CALCULATETABLE(YourTable,YourTable[STATUS]="green")
Then in the new table, create the following column and measure.
Column = DATE(YEAR('Table'[ANALYSIS DATE]),MONTH('Table'[ANALYSIS DATE]),DAY('Table'[ANALYSIS DATE])-70)
Measure = CALCULATE(COUNTA('Table'[PERSON]),DATESBETWEEN('Table'[ANALYSIS DATE],MAX('Table'[Column]),MAX('Table'[ANALYSIS DATE])))
At last, create a table visual using date field and measure of the new table.
Regards,
Lydia
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |