Forum Discussion
fernamario
2 years agoRegular 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 tim...
Anonymous
2 years agoNot applicable
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.