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
marsclone
Helper IV
Helper IV

Week to Date Measure

Hi,

 

I'm struggling to get Week Measures to work. YTD Measures are working.

 

What am i doing wrong?

 

Test

 

Thank you for your help!

 

Regards Marcel

1 ACCEPTED SOLUTION

Hi,

 

 

TotalAmount WTD = 
CALCULATE (
    [TotalAmount],
    'Date'[Weeknumber] = WEEKNUM(TODAY()))
Total Amount WTD LW = CALCULATE([TotalAmount], 'Date'[Weeknumber] = WEEKNUM(TODAY())-1)
Difference = [TotalAmount WTD] - [Total Amount WTD LW]

Have you tried these code?

 

2019_07_10_14_45_02_Test_BI_Week_Read_Only_Power_BI_Desktop.png

View solution in original post

7 REPLIES 7
v-xicai
Community Support
Community Support

Hi @marsclone ,

 

I am not sure what desired result would you want, could you please clarify and share the desired output screenshots for further analysis? Do mask sensitive data before uploading.

 

Please read this post to get your answer quickly: How to Get Your Question Answered Quickly.

 

Best Regards,

Amy

Hi @v-xicai 

 

Thank you for your help!

 

In my file there are only 2 weeks of data, but what i would like to achieve, is to calculate "Week to Date" - "Last Week" and the Difference between those.

 

It would look like

 

BronWeek to DateLast WeekDifference
 542.774,49507.530,0935.244,40
Location1629.853,40605.535,5924.317,81
Location2994.774,12957.262,2237.511,90
Location3136.540,00130.824,005.716,00
Location4457.356,40437.482,4319.873,97
Location51.280.081,821.228.250,9251.830,90
Location6176.212,00176.212,000,00
Location7107.014,0092.896,0014.118,00
Location8200.140,90189.631,8110.509,09
Location9721.716,89693.739,7027.977,19
Location10105.753,74101.705,564.048,18
Location11269.247,71251.421,3017.826,41
Location12233.887,80190.492,5843.395,22
Location131.127.689,641.074.360,4453.329,20
Totaal6.983.042,916.637.344,64345.698,27

 

Thank you!

Regards Marcel

Hi,

 

 

TotalAmount WTD = 
CALCULATE (
    [TotalAmount],
    'Date'[Weeknumber] = WEEKNUM(TODAY()))
Total Amount WTD LW = CALCULATE([TotalAmount], 'Date'[Weeknumber] = WEEKNUM(TODAY())-1)
Difference = [TotalAmount WTD] - [Total Amount WTD LW]

Have you tried these code?

 

2019_07_10_14_45_02_Test_BI_Week_Read_Only_Power_BI_Desktop.png

Hi @mussaenda 

 

Thank you, these measures work.

There are really many ways to calculate something!

 

My Weekdata are cumulative, is there a measure that calculate all the differences between the weeks?

 

greetings

Marcel

Your desired output will be?

Hi @mussaenda 

 

The output would be like this

 

I've added a testfile

 

Test File

 

 

Bron2425262728Totaal
 369.989,4441.109,9345.677,7150.753,0135.244,40542.774,49
Location1441.435,4549.048,3854.498,2060.553,5624.317,81629.853,40
Location2697.844,1677.538,2486.153,6095.726,2237.511,90994.774,12
Location395.370,7010.596,7411.774,1613.082,405.716,00136.540,00
Location4318.924,6935.436,0839.373,4243.748,2419.873,97457.356,40
Location5895.394,9299.488,33110.542,58122.825,0951.830,901.280.081,82
Location6128.458,5514.273,1715.859,0817.621,200,00176.212,00
Location767.721,187.524,588.360,649.289,6014.118,00107.014,00
Location8138.241,5915.360,1717.066,8718.963,1810.509,09200.140,90
Location9505.736,2456.192,9262.436,5769.373,9727.977,19721.716,89
Location1074.143,358.238,159.153,5010.170,564.048,18105.753,74
Location11183.286,1320.365,1322.627,9125.142,1317.826,41269.247,71
Location12138.869,0915.429,9017.144,3319.049,2643.395,22233.887,80
Location13783.208,7687.023,2096.692,44107.436,0453.329,201.127.689,64
Totaal4.838.624,25537.624,92597.361,01663.734,46345.698,276.983.042,91

Hello @marsclone ,

 

Untitled.png

I have achieved your desired output.

But I know this not the 100% correct solution. I hope our experts here will help you too.

Forgive me I am not good at this.

 

Link is here.

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.