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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SumitDubey
Helper I
Helper I

ytd growth for weeks as well

is there any way to do ytd for weeks as well


like
year
month
week
day

like this for column chart its not working for weeks for me otherwise its working well please help me out

 
IF(
ISFILTERED('DATE'[Date]),
ERROR("ERROR"),
TOTALYTD([IB oS], 'DATE'[Date].[Date])
)
 
 
 
YTD GROWTH IB oS = 
IF(
ISFILTERED('DATE'[Date]),
ERROR("ERROR"),
VAR __PREV_YEAR = CALCULATE([IB oS YTD], DATEADD('DATE'[Date].[Date], -1, YEAR))
RETURN
DIVIDE([IB oS YTD] - __PREV_YEAR, __PREV_YEAR)
)



SumitDubey_0-1707315914892.png




Or is there any option i can use hierarchy instead of date in calculation

or how can i get correct calculation in weeks as well on same measure

 


@Daniel29195
@lbendlin 

@amitchandak 
@Idrissshatila 

 

1 ACCEPTED SOLUTION

Works for me - you just need to use the separate computation with the -364. All others can use SAMEPERIODLASTYEAR.

View solution in original post

13 REPLIES 13
SumitDubey
Helper I
Helper I

td is not working for weeks thats why growth is not working for weeks

 

lbendlin
Super User
Super User

weeks are incompatible with months. You need to be very specific how you want to portion that.

Is there anything i can do to get it for weeks as well like using sameperiod last year or something because i need to get it for weeks as well in my report 

Hi @SumitDubey ,

Maybe you can add a new column in your table using this DAX:

 

WEEK = WEEKNUM('Table'[Date])

 

The output is as below:

vjunyantmsft_0-1707358123461.pngvjunyantmsft_1-1707358135797.png

This will return the number of weeks each date corresponds to in the current year.
WEEKNUM function (DAX) - DAX | Microsoft Learn
Also, in DAX calculations, the date structure hierarchy does not include the week as a level, and you need to use the week number alone instead of the hierarchy.

vjunyantmsft_2-1707358296216.png

 



Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

subtract 364 from the date for an approximation of "same week last year" 

I tried it was not working 

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...

DateCountryPenDesk
2021-10-11 15:41:05Australia3028
2023-04-20 00:09:44USA651
2021-10-19 04:10:56Australia5836
2020-06-19 01:35:27Germany742
2023-03-04 04:32:10India4624
2020-10-24 16:09:58USA1215
2023-11-19 07:26:51USA168
2021-07-13 17:35:51Russia5719
2024-01-08 00:04:59Canada6435
2020-10-11 16:53:15Japan3423
2024-02-10 20:03:29Japan3216
2023-02-09 21:06:01Canada787
2023-12-24 23:02:09USA7718
2020-01-13 18:58:58Brazil7438
2024-05-13 22:04:50Canada7929
2021-12-23 17:30:09Australia4744
2020-11-09 08:59:11Japan7039
2024-04-04 21:42:57China5742
2024-02-04 07:59:05Canada2812
2020-05-28 20:56:00France7446
2023-01-18 20:17:56India229
2021-12-02 06:32:44Japan939
2022-05-30 07:50:43Australia2045
2022-08-26 14:04:46Japan3636
2020-09-27 00:03:34USA442
2022-01-20 11:04:21Canada3948
2024-07-04 09:41:48Russia827
2020-10-26 11:24:36Brazil4631
2020-08-28 18:13:44China9221
2023-10-03 16:57:49France9026
2023-04-18 02:42:42Brazil1527
2020-09-10 18:37:22Germany5023
2020-11-20 14:32:17Russia3517
2024-05-22 14:55:43France941
2020-11-20 14:13:32Japan12
2023-06-14 12:22:10China809
2023-12-28 22:45:50India4915
2020-03-05 02:13:34China7019
2021-09-20 23:28:50Canada427
2024-04-15 07:28:55Brazil124
2021-06-03 11:25:55Brazil7843
2023-12-21 15:13:35China6331
2024-02-05 15:01:11Australia3240
2024-06-11 23:34:42Australia6034
2021-03-24 07:26:02Canada2422
2020-07-20 03:53:09Brazil614
2023-02-10 04:58:27Russia5233
2022-01-07 18:33:53Australia4224
2024-11-27 21:08:17Canada1221
2020-04-13 11:01:21USA6610
2020-07-17 20:52:13Brazil6141
2020-08-09 11:45:30France6025
2021-08-20 06:10:58USA9650
2022-08-28 02:42:44Germany5847
2023-09-03 19:49:59India1120
2024-06-19 12:35:31China8618
2022-01-31 16:39:01Germany8445
2024-03-05 08:15:04USA6350
2022-07-11 21:21:56Russia2519
2020-06-24 19:56:56USA6842
2024-03-25 21:16:12Australia5219
2024-03-09 08:43:35Germany3327
2024-10-12 03:53:52China9844
2024-07-21 09:41:11Japan9737
2023-10-05 10:07:38Japan9846
2022-04-11 23:59:51Canada495
2023-11-09 06:00:43Canada9129
2020-07-11 20:44:54Germany7638
2024-09-14 22:07:51Canada5535
2022-11-02 12:43:48Japan756
2024-08-13 18:56:24Brazil324
2022-09-06 16:43:55USA9310
2021-03-30 12:30:33Canada159
2023-11-25 01:16:04China6420
2024-05-03 23:02:16Germany450
2022-01-02 23:01:09China3920
2021-03-16 05:39:30Australia338
2023-10-12 03:46:54France356
2021-04-05 23:47:19China7345
2024-03-22 15:36:25China683
2021-11-19 13:28:59France5343
2021-10-05 08:06:35USA1435
2022-03-25 07:18:38China6531
2020-10-07 22:50:35Canada6645
2024-07-11 00:29:18India2535
2023-08-21 09:00:18Canada1447
2022-08-03 00:17:41Canada1746
2020-12-14 12:57:42USA8623
2024-05-04 03:34:35Brazil854
2023-04-02 01:01:07Brazil7616
2023-06-20 10:04:36China10022
2020-09-11 19:21:38USA3637
2023-12-14 07:49:27China1313
2023-03-22 07:31:09India3550
2021-10-03 03:07:26Russia337
2024-11-07 09:57:49Brazil9738
2023-08-22 02:34:05Australia196
2021-08-07 12:13:59Germany3947
2021-01-18 04:31:17Canada9613
2024-11-20 02:25:40France4724



like this 

now i have to get 
ytd
ytd grwoth %(like 2022vs2023 and when some value is blank it shows 0 like after 2024 feb it should show 0)


cluster column kine chart


x axis 

year month week day

now i have to do it so it can be drill down and everything and check data

 

lbendlin_0-1707342614966.png

 

 

So if we drill it to day or drill to years it will work 

and could you please also help me with ytd growth

You mean YoY growth.  That is usually done as 

 

DIVIDE(current-sply,abs(sply),0)

Year over year not working for weeks

Works for me - you just need to use the separate computation with the -364. All others can use SAMEPERIODLASTYEAR.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.