Forum Discussion
Date range on visualization
- Anonymous9 years ago
Hi Velias,
You can write the following formulas to calculate percent difference. For mor details, please review the example in the attached PBIX file.
1. Create a measure that calculate sessions between 2016,9,5 and 2016,9,7.
Sessionsum = CALCULATE(SUM(Table2[Sessions]), DATESBETWEEN(Table2[Date],DATE(2016,9,5), DATE(2016,9,7)))
2. Create a measure that calculate sessions difference between two date ranges.
Session difference = CALCULATE(SUM(Table2[Sessions]), DATESBETWEEN(Table2[Date],DATE(2016,9,9), DATE(2016,9,11)))-CALCULATE(SUM(Table2[Sessions]), DATESBETWEEN(Table2[Date],DATE(2016,9,5), DATE(2016,9,7)))
3. Create a measure that calculate percent difference and format the measure using the following percentage option.
Percent difference = DIVIDE([Session difference],[Sessionsum])Thanks,
Lydia Zhang
| Date | Sessions |
| 05.09.2016 | 1000 |
| 06.09.2016 | 1500 |
| 07.09.2016 | 1500 |
| 08.09.2016 | 900 |
| 09.09.2016 | 1200 |
| 10.09.2016 | 2000 |
| 11.09.2016 | 2500 |
for example: 09.09.2016 - 11.09.2016 above 43% than 05.09.2016 - 07.09.2016 etc.
Hi Velias,
You can write the following formulas to calculate percent difference. For mor details, please review the example in the attached PBIX file.
1. Create a measure that calculate sessions between 2016,9,5 and 2016,9,7.
Sessionsum = CALCULATE(SUM(Table2[Sessions]), DATESBETWEEN(Table2[Date],DATE(2016,9,5), DATE(2016,9,7)))
2. Create a measure that calculate sessions difference between two date ranges.
Session difference = CALCULATE(SUM(Table2[Sessions]), DATESBETWEEN(Table2[Date],DATE(2016,9,9), DATE(2016,9,11)))-CALCULATE(SUM(Table2[Sessions]), DATESBETWEEN(Table2[Date],DATE(2016,9,5), DATE(2016,9,7)))
3. Create a measure that calculate percent difference and format the measure using the following percentage option.
Percent difference = DIVIDE([Session difference],[Sessionsum])
Thanks,
Lydia Zhang