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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
BI2018No
Frequent Visitor

Get weekly change - first hour in week compared to previous weeks first hour

Hello!

 

I have a table with 5 columns. Time, ISOWeek, Year, TSID and Value

 

I am interessted in getting the weekly change in value from this weeks first hour compared to previous week first hour. This should work for all time series. I have manually made a extra colum from "year - week". This is linked to a slicer. When i clik week 51 2018, I want to compare hour 1 this week with hour 1 week 50 2018, and so on. How is this done in DAX?

1 ACCEPTED SOLUTION

Hello @BI2018No

 

I have a uploaded a pbix file for you here: https://1drv.ms/u/s!AiiWkkwHZChHj1VliszSzataBKpB

 

there are a bit of changes to do to your model, especially you need to create a calendar with IsoWeek Number and Iso Week Year and create an additional dimension table for the Hours. 

You will see details in the file

 

 

 

 

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

View solution in original post

4 REPLIES 4
LivioLanzo
Solution Sage
Solution Sage

Hi @BI2018No

 

should be possible to do this. Are you able to post a sample of your data?

 

 

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

 

For week 2 ID=1 I'd like to substract 1 from 2 and for ID=2 18 from 20 and so on.

 

DateTimeIsoWeekYearTSIDValue
01.01.2019 001201911
01.01.2019 011201912
01.01.2019 021201913
01.01.2019 031201914
01.01.2019 041201915
     
08.01.2019 002201912
08.01.2019 012201913
08.01.2019 022201914
08.01.2019 032201915
08.01.2019 042201916
     
01.01.2019 0012019210
01.01.2019 0112019212
01.01.2019 0212019214
01.01.2019 0312019216
01.01.2019 0412019218
     
08.01.2019 0022019212
08.01.2019 0122019214
08.01.2019 0222019216
08.01.2019 0322019218
08.01.2019 0422019220

Hello @BI2018No

 

I have a uploaded a pbix file for you here: https://1drv.ms/u/s!AiiWkkwHZChHj1VliszSzataBKpB

 

there are a bit of changes to do to your model, especially you need to create a calendar with IsoWeek Number and Iso Week Year and create an additional dimension table for the Hours. 

You will see details in the file

 

 

 

 

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

The solution works great! Power BI works out of the box for days, months, quaters and years. Week seems to be a bit harder, at least for me. But obvious not for you! Thanks a lot! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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