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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
StevesHelp
Helper I
Helper I

How to get WTD, MTD, and YTD to show in one table?

Attached is what I'm working on currently. You will see the data with colored headings, how I am slicing the data, and what my answers should be.

 

Depending on my slicer, I will get the right answers in different spots, but I can never get all 9 columns to be correct at once.

 

Any advice?

 

Capture.PNG

 

Thanks a ton!

3 REPLIES 3
Greg_Deckler
Super User
Super User

My advice would be to post sample/example data and you formulas in a way that can be copied and pasted.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

I can't figure out how to upload a spreadsheet here, but does this work:

 

DATEExt_Retail
1/12/2015$169,052
1/19/2015$183,719
1/26/2015$165,640
2/2/2015$174,082
2/9/2015$180,478
2/16/2015$197,585
2/23/2015$191,193
3/2/2015$200,089
3/9/2015$197,684
3/16/2015$182,222
3/23/2015$173,435
3/30/2015$155,332
4/6/2015$182,507
4/13/2015$191,372
4/20/2015$179,530
4/27/2015$180,206
5/4/2015$166,501
5/11/2015$189,743
5/18/2015$194,482
5/25/2015$178,499
6/1/2015$195,290
6/8/2015$195,729
6/15/2015$191,508
6/22/2015$215,859
6/29/2015$201,744
7/6/2015$215,649
7/13/2015$209,293
7/20/2015$209,553
7/27/2015$212,104
8/3/2015$209,641
8/10/2015$191,027
8/17/2015$200,215
8/24/2015$202,384
8/31/2015$211,102
9/7/2015$181,487
9/14/2015$220,846
9/21/2015$192,859
9/28/2015$203,522
10/5/2015$208,473
10/12/2015$214,991
10/19/2015$196,461
10/26/2015$206,914
11/2/2015$203,937
11/9/2015$203,954
11/16/2015$211,026
11/23/2015$175,661
11/30/2015$225,567
12/7/2015$216,728
12/14/2015$279,271
12/21/2015$197,019
12/28/2015$261,747
1/4/2016$321,961
1/11/2016$345,838
1/18/2016$372,718
1/25/2016$390,068
2/1/2016$360,642
2/8/2016$418,110
2/15/2016$438,332
2/22/2016$429,254
2/29/2016$450,656
3/7/2016$452,104
3/14/2016$466,763
3/21/2016$435,036
3/28/2016$474,686
4/4/2016$460,508
4/11/2016$466,570
4/18/2016$397,043
4/25/2016$491,198
5/2/2016$514,877
5/9/2016$531,587
5/16/2016$539,159
5/23/2016$591,540
5/30/2016$493,242
6/6/2016$548,361
6/13/2016$558,764
6/20/2016$589,399
6/27/2016$556,259
7/4/2016$564,228
7/11/2016$571,573
7/18/2016$552,159
7/25/2016$558,423
8/1/2016$537,322
8/8/2016$509,192
8/15/2016$469,502
8/22/2016$522,735
8/29/2016$529,490
9/5/2016$490,090
9/12/2016$489,350
9/19/2016$488,354
9/26/2016$521,206
10/3/2016$516,400
10/10/2016$551,840
10/17/2016$518,378
10/24/2016$484,381
10/31/2016$457,690
11/7/2016$485,611
11/14/2016$493,543
11/21/2016$401,972
11/28/2016$450,651
12/5/2016$440,533
12/12/2016$443,642
12/19/2016$378,689
12/26/2016$415,055
1/2/2017$421,402
1/9/2017$438,583
1/16/2017$421,025
1/23/2017$458,341
1/30/2017$451,191
2/6/2017$460,470
2/13/2017$434,284
2/20/2017$482,013
2/27/2017$480,165
3/6/2017$517,896
3/13/2017$533,495
3/20/2017$518,537
3/27/2017$496,198
4/3/2017$535,682
4/10/2017$463,841
4/17/2017$501,283
4/24/2017$519,516
5/1/2017$524,249
5/8/2017$482,943
5/15/2017$481,337
5/22/2017$480,456
5/29/2017$484,799
6/5/2017$485,960
6/12/2017$463,495
6/19/2017$475,169
6/26/2017$483,521
7/3/2017$474,316
7/10/2017$492,384
7/17/2017$513,183
7/24/2017$495,834
7/31/2017$508,625
8/7/2017$494,542
8/14/2017$467,360
8/21/2017$329,012
8/28/2017$406,555
9/4/2017$777,799
9/11/2017$1,145,341
9/18/2017$1,420,430
9/25/2017$1,644,287
10/2/2017$1,767,188
10/9/2017$1,834,219
10/16/2017$1,809,408
10/23/2017$1,950,524
10/30/2017$1,780,104
11/6/2017$1,855,337
11/13/2017$1,768,844
11/20/2017$1,397,236
11/27/2017$1,714,938
12/4/2017$1,497,874
12/11/2017$1,441,836
12/18/2017$1,228,510
12/25/2017$996,400
1/1/2018$1,145,989
1/8/2018$1,263,395
1/15/2018$981,925
1/22/2018$1,204,306
1/29/2018$1,171,378
2/5/2018$1,110,136
2/12/2018$1,119,480

Total Retail Sales = sum(THD[Ext_Retail])

WTD $ Sale = CALCULATE((THD[Total Retail Sales]),DATESBETWEEN(DATE_DIMENSIONS[DATE],LASTDATE(DATE_DIMENSIONS[DATE])-weekday(LASTDATE(DATE_DIMENSIONS[DATE]),2)+1, LASTDATE(DATE_DIMENSIONS[DATE])))
WTD LY $ Sales = CALCULATE([WTD $ Sales], SAMEPERIODLASTYEAR(DATE_DIMENSIONS[DATE]))
WTD $ Comp % = DIVIDE( ([WTD $ Sales]- [WTD LY $ Sales]),[WTD LY $ Sales])

MTD $ Sales = TOTALMTD(('THD'[Total Retail Sales]), 'DATE_DIMENSIONS'[DATE])
LY MTD $ Sales = CALCULATE([MTD $ Sales], SAMEPERIODLASTYEAR(DATE_DIMENSIONS[DATE]))
MTD $ Comp % = DIVIDE( ([MTD $ Sales] - [LY MTD $ Sales]),[LY MTD $ Sales])

FYTD $ Sales = TOTALYTD('THD'[Total Retail Sales]),'DATE_DIMENSIONS'[DATE],"1/26/2018")
PFYTD $ Sales = CALCULATE([FYTD $ Sales], SAMEPERIODLASTYEAR((DATE_DIMENSIONS[DATE])))
YTD Comp % ($) = Divide(([FYTD $ Sales] - [PFYTD $ Sales]),[PFYTD $ Sales])

Will work on getting sample data shortly. Thanks

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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