Forum Discussion
Show Changes between two given periods
- 8 years ago
Hi Aroth,
Measure = CALCULATE([net]),FILTER(ALL(MONTHS),MONTHS[index] = MAX(MONTHS[index]))-CALCULATE([net]),FILTER(ALL(MONTHS), MONTHS[index] = MIN(MONTHS[index] )Based on above measure, I could get the desired output.
What we need is add a MonthNo column to original table (suppose it's 'Month-Project'), and insert an extra table (in my test, it's named as 'Month') listing unique month values.
Create measure like:
Diff = CALCULATE ( ( [net] ), FILTER ( 'Month-Project', 'Month-Project'[MonthNo] = MAX ( 'Month'[MonthNo] ) ) ) - CALCULATE ( ( [net] ), FILTER ( 'Month-Project', 'Month-Project'[MonthNo] = MIN ( 'Month'[MonthNo] ) ) )Add field [Month] from 'Month' table. Add [Project] and [Diff] from 'Month-Project' table.
Best regards,
Yuliana Gu
Greg_Deckler thank you for answer, I'm not sure how I can use that as everything is on the same data base (table):
| Month | Project | net |
| October | P1 | 12 |
| October | P2 | 5 |
| October | P3 | 5 |
| December | P2 | 6 |
| December | P3 | 4 |
| December | P4 | 10 |
That's why I use CALCULATE to filter on one month and substract by another CALCULATE filtered on an other month.
And my "net" field is a measure...
Wow, I way over complicated that. Just create a measure:
Measure = CALCULATE(SUM(Projects[net]),Projects[Month]="December")-CALCULATE(SUM(Projects[net]),Projects[Month]="October")
Then put your Project column and this measure into a Table visualization.
- Aroth8 years ago
Advocate II
That's what I did, the only thigs Iv'e added is :
Measure = CALCULATE([net]),FILTER(ALL(MONTHS),MONTHS[index] = MAX(MONTHS[index]))
-CALCULATE([net]),FILTER(ALL(MONTHS), MONTHS[index] = MIN(MONTHS[index] )
So it enable to compare two selected periods ...
- v-yulgu-msft8 years ago
Microsoft Employee
Hi Aroth,
Measure = CALCULATE([net]),FILTER(ALL(MONTHS),MONTHS[index] = MAX(MONTHS[index]))-CALCULATE([net]),FILTER(ALL(MONTHS), MONTHS[index] = MIN(MONTHS[index] )Based on above measure, I could get the desired output.
What we need is add a MonthNo column to original table (suppose it's 'Month-Project'), and insert an extra table (in my test, it's named as 'Month') listing unique month values.
Create measure like:
Diff = CALCULATE ( ( [net] ), FILTER ( 'Month-Project', 'Month-Project'[MonthNo] = MAX ( 'Month'[MonthNo] ) ) ) - CALCULATE ( ( [net] ), FILTER ( 'Month-Project', 'Month-Project'[MonthNo] = MIN ( 'Month'[MonthNo] ) ) )Add field [Month] from 'Month' table. Add [Project] and [Diff] from 'Month-Project' table.
Best regards,
Yuliana Gu
- Aroth8 years ago
Advocate II
Thanks !!
I finaly understood my issue. The relation between the two tables had the cross filter selection in both ways!!
I changed it to "single" and now it works :)