Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Power BI Community,
I have a Table in which there are three columns with the consumption values and a temperature column.
I need to calculate the consumption depending on the temperature.
Example: In two hour 11 AM to 1 PM consumption the temperature from 11 AM to 12 PM might be below 35 degree and from 12 PM to 1 PM it might be above 40 degree.
So I want to calculate the consumption depending on temp for the Selected time period may be 1 hour or 2 hour, 1 day, one week, month, year.
Please give a Solution.
Thanks&Regards,
Ibrahim.
Solved! Go to Solution.
Hi @Ibrahim_shaik ,
Based on the information you provided, I have created a sample data to solve your problem and you can follow the steps below:
1. Add an index column.
2. Add a calculated column that calculates the difference in time.
hour =
VAR _index = 'Table'[Index]
VAR _1 =
CALCULATE (
MAX ( 'Table'[Time] ),
FILTER ( 'Table', 'Table'[Index] = _index - 1 )
)
VAR _hour =
DATEDIFF ( 'Table'[Time], _1, HOUR )
RETURN
_hour
3. Add a measure that calculates the loss when the time is one hour apart.
hour Consumption =
CALCULATE (
SUM ( 'Table'[consumption] ),
FILTER ( 'Table', 'Table'[hour] = -1 )
)
Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Ibrahim_shaik ,
Based on the information you provided, I have created a sample data to solve your problem and you can follow the steps below:
1. Add an index column.
2. Add a calculated column that calculates the difference in time.
hour =
VAR _index = 'Table'[Index]
VAR _1 =
CALCULATE (
MAX ( 'Table'[Time] ),
FILTER ( 'Table', 'Table'[Index] = _index - 1 )
)
VAR _hour =
DATEDIFF ( 'Table'[Time], _1, HOUR )
RETURN
_hour
3. Add a measure that calculates the loss when the time is one hour apart.
hour Consumption =
CALCULATE (
SUM ( 'Table'[consumption] ),
FILTER ( 'Table', 'Table'[hour] = -1 )
)
Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You would usually use a scatter plot for this.
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.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |