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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

Issues with comparing data using date ranges

I am new to PowerBI and defenitely not an expert or developer. I was able to create a report based on an excel file which contains server names, CPU - Avail memory and % of avail memory, date and time. I need to be able to compare utilization between Feb 2 - 16 and then from Feb 20 - March 1 to show any utilization spikes after adding a new customer. I have tried using a Measure and an If statement with no luck. The excel sheet contains:

server name
date time
avail mem
% of avail mem


it has an hour entry (24 in one day).


Any advice? Thank you in advance.

Community Support
Community Support

Hi @fernamario ,

Based on your description, I understand utilization as the "% of avail mem" field. The following data was created:



1. Create a measure, write an expression, calculate the average utilization of the two dates, and then compare.

Measure =
VAR DateRange1 = FILTER(ALL('Table'),'Table'[date time] >= DATE(2024,2,2) && 'Table'[date time] <= DATE(2024,2,16))
VAR Utilization1 = CALCULATE(AVERAGE('Table'[% of avail mem]), DateRange1)
VAR DateRange2 = FILTER(ALL('Table'),'Table'[date time] >= DATE(2024,2,20) && 'Table'[date time] <= DATE(2024,3,1))
VAR Utilization2 = CALCULATE(AVERAGE('Table'[% of avail mem]), DateRange2)
IF(Utilization1 >= Utilization2,Utilization1,Utilization2)

2. The final result is shown in the figure below.



If my understanding is wrong, please provide more detailed pbix files or screenshots to better help you solve the problem.


Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Clara, unfortunately, the results are skewed after I applied the measure. Would it be easier if I attached the files for your review? 

Hi @fernamario ,

Yes, if you upload the file and provide the desired effect, I will understand you better and help you get the desired result. If your data volume is relatively large or has private data, you can create some representative data yourself for easier understanding.


Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

The % of mem is redundant.



Note the blue "i"  - that is a (bad) indicator that not all data is shown.  If you want to avoid the automatic sampling yu need to bring your own. 


Ibendlin, thank you for your response. However, I dont understand what you mean by " If you want to avoid the automatic sampling yu need to bring your own. "

You need to make your own decision on how to aggregate the data, or else Power BI will make that decision for you.

Clara, unfortuantely, I cannot upload the file since the org blocks the use of any external cloud storage. Any other options? Let me see if I can use my home PC and personal account to upload. 

Clara, thank you so much for this. One question, if I wanted to run this for each server, what is needed in the Measure?

I changed the values for % of avail mem to CPU and Avail Mem for different measures. 

Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to

Please show the expected outcome based on the sample data you provided.

Want faster answers?

Helpful resources

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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


Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.