cancel
Showing results 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
cpu
avail mem
% of avail mem

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

10 REPLIES 10
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)
RETURN
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.

Regular Visitor

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

Community Support

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.

Regular Visitor
Super User

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.

Regular Visitor

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. "

Super User

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

Regular Visitor

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.

Regular Visitor

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

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 https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

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