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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Stella_V
Frequent Visitor

Calculate a hourly difference per dimensions

Hello 

I am trying to calculate a hourly difference, for the selected day in a date slicer, between two attributes.

More precisely I want to calculate th difference in "Value" between France and Austria, per hour on the same day, for the attribute  'forecast1'.

 

 TimeHourAttribute1Attribute2Value
D24.10.20231.00AustriaForecast110
D24.10.20232.00AustriaForecast120
D24.10.20233.00AustriaForecast130
D24.10.20234.00AustriaForecast140
D24.10.20235.00AustriaForecast150
D24.10.20231.00FranceForecast125
D24.10.20232.00FranceForecast1140
D24.10.20233.00FranceForecast160
D24.10.20234.00FranceForecast150
D24.10.20235.00FranceForecast165
      
 ResulthourAttribute3Attribute2Value
 24.10.20231.00France-AutriaForecast115
 24.10.20232.00France-AutriaForecast1120
 24.10.20233.00France-AutriaForecast130
 24.10.20234.00France-AutriaForecast110
 24.10.20235.00France-AutriaForecast115

 

Can you please help me? I did a direct query. 

thank you very much !

Stella

 

2 ACCEPTED SOLUTIONS
barritown
Super User
Super User

Hi @Stella_V,

If you want to solve your task via a Table visual, you could create such a measure and use it:

barritown_1-1698091943077.png

In plain text:

NewValue = SUMX ( FILTER ( Data, [Attribute1] = "France" ), [Value] ) - SUMX ( FILTER ( Data, [Attribute1] = "Austria" ), [Value] )

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

View solution in original post

@Stella_V,

 

This approach will work with multiple Forecasts (Forecast1, Forecast2, etc.) - I dare you to try. 🙂 Should you face any issues, let me know.

 

>>Should we add an additional filter on the Attribute2?

There is no need to apply additional filtering.

 

Cheers,

Alexander

View solution in original post

4 REPLIES 4
Stella_V
Frequent Visitor

It works perfectly!!! thank you!!!!!

barritown
Super User
Super User

Hi @Stella_V,

If you want to solve your task via a Table visual, you could create such a measure and use it:

barritown_1-1698091943077.png

In plain text:

NewValue = SUMX ( FILTER ( Data, [Attribute1] = "France" ), [Value] ) - SUMX ( FILTER ( Data, [Attribute1] = "Austria" ), [Value] )

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

Hello 

 

thank you very much for your answer. 

 

I forgot to mention you that there are several different attributes in the column "Attribute 2" for example: 

 

Hour 1 Forecast1

Hour 2 Forecast1

Hour 3 Forecast1

Hour 4 Forecast1

 

Hour 1 Forecast2

Hour 2 Forecast2

Hour 3 Forecast2

Hour 4 Forecast2

 

Hour 1 Forecast3

Hour 2 Forecast3

Hour 3 Forecast3

Hour 4 Forecast3

 

Should we add an additional filter on the Attribute2? What  I need is the hourly difference between two countries, per forecast type.

 

thank you !!
Stella

 

 

@Stella_V,

 

This approach will work with multiple Forecasts (Forecast1, Forecast2, etc.) - I dare you to try. 🙂 Should you face any issues, let me know.

 

>>Should we add an additional filter on the Attribute2?

There is no need to apply additional filtering.

 

Cheers,

Alexander

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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