Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Velias
Regular Visitor

Date range on visualization

Greetings! Please tell me how I can add to the visualization tools dashboards date range, as well as the opportunity to compare the two ranges and display the percentage difference?

1 ACCEPTED SOLUTION

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])
1.PNG

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Velias
Regular Visitor

Greetings! Please tell me how I can add to the visualization tools dashboards date range, as well as the opportunity to compare the two ranges and display the percentage difference?

Hi @Velias,

Based on your description, it’s difficult for us to provide detailed solution. Could you please share sample data of your scenario and post expected result here?

In addition, if you just need a date range selector to filter data in your report, you can use  the Timeline custom visual.


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-yuezhe-msft!

 

Timeline custom visual - good thing.

 

To solve their problems I need to compare periods. For example a visit to the site 09.05.2016 - 11.09.2016 compared with 29/08/2016 - 09/04/2016 or 08/09/2016 compared to 04/08/2016. Need a percentage of the difference of the two periods specified manually.

Example: site visits in the period 05.09.2016 - 11.09.2016 up 25 percent of visits to the site 08/29/2016 - 04/09/2016

Sorry for my English 😞

 

 

Hi @Velias,


Could you please post sample data with a table ?

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

DateSessions
05.09.20161000
06.09.20161500
07.09.20161500
08.09.2016900
09.09.20161200
10.09.20162000
11.09.20162500

 

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])
1.PNG

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.