Forum Discussion
Combine 2 Date Columns from different Tables
Hi guys,
so I have a Date Slicer on my Dashboard. Where I´m using the "Goods receipt date" Data from a table called SCR.
I also added a new Date Column which is a join from a different Table (ComplaintTable) called "CreatedOn" to the SCR Table.
A little background to my Table:
SCR Table
[ComplaintTable_ComplaintNumber]
[Goods receipt Date] 01.01.2023 - Today
[ComplaintTable_CreatedOn] 01.01.2023 - Today
[KEYX]
ComplaintTable
[CreatedOn] 01.01.2009 - Today
[ComplaintNumber]
[KEYX]
So my problem is, that I have to use the SCR Table for my slicer, but some Complaints are before 01.23 and I want to Include them. So I need like my GoodsReceiptDate + CreatedOn 3 Years before last GoodsReceiptDate.
I started adding a new table with a regular Calendar starting from 01.01.2020 and added following data:
Maybe some of you guys, know how to fix that.
Hi,
To start with, you should create a Calendar Table. Create a relationship (Many to One and Single) from the Date column of both Fact Tables to the Date column of the Calendar Table. Create calculated column formulas for Year, Month name and Month number. Sort the Month name column by the Month number. To any visual, drag Year/Month name/Date from the Calendar Table.
4 Replies
- ryan_mayu
Super User
could you pls provide some sample data of two tables(not the screenshot) and the expected output?
- imannsv11Regular Visitor
So, I count the rows of SCR[ComplaintTable.ComplaintNumber] and if SCR[ComplaintTable.ClosedOn] is not null, I mark them as Complaints on my Dashboard. However, some complaints were opened about two years ago and do not count in my data because the GoodsReceiptDate only starts counting at the beginning of 2023. I want to include these additional complaints that were opened two years ago. Therefore, I want to include them in my data when I move it on my Date Slicer.
SCRItemID
4504066908_20_1OrderNr
4504066908Pos
20SupplierNr
5101113OrderDate
10.05.2022GoodsReceiptDate
01.03.2023KEYX
4504066908_20ComplaintTable.ComplaintNumber
nullComplaintTable.CreatedOn
nullComplaintTable.ClosedOn
null4504055832_22_1 4504055832 22 5101113 20.04.2022 01.06.2023 4504055832_22 null null null 4503993561_10_1 4503993561 10 5101113 12.01.2022 01.08.2023 4503993561_10 null null null 4504164011_10_1 4504164011 10 5101113 01.11.2022 01.08.2023 4504164011_10 500200053211 07.08.2023 13.10.2023 4504037368_10_1 4504037368 10 5101113 28.03.2022 01.08.2023 4504037368_10 null null null 4504037368_20_1 4504037368 20 5101113 28.03.2022 01.08.2023 4504037368_20 null null null 4504037368_30_1 4504037368 30 5101113 28.03.2022 01.08.2023 4504037368_30 null null null 4504037369_10_1 4504037369 10 5101113 28.03.2022 01.08.2023 4504037369_10 null null null 4504037369_20_1 4504037369 20 5101113 28.03.2022 01.08.2023 4504037369_20 null null null 4504037369_30_1 4504037369 30 5101113 28.03.2022 01.08.2023 4504037369_30 null null null 4504071238_100_1 4504071238 100 5240592 23.05.2022 02.01.2023 4504071238_100 500200054085 13.12.2023 29.01.2024 4504071238_100_1 4504071238 100 5240592 23.05.2022 02.01.2023 4504071238_100 500200053770 06.11.2023 05.12.2023 4504040309_50_1 4504040309 50 5600177 31.03.2022 02.01.2023 4504040309_50 null null null 4504042218_20_1 4504042218 20 5240592 04.04.2022 02.01.2023 4504042218_20 null null null 4504050067_110_1 4504050067 110 5242297 12.04.2022 02.01.2023 4504050067_110 null null null 4504050705_10_1 4504050705 10 5240592 11.04.2022 02.01.2023 4504050705_10 null null null
ComplaintTableComplaintNumber
500200003563CreatedIb
12.01.2009EinkBeleg
nullPos
nullSupplier
nullClosedOn
12.01.2009KEYX
null500200003632 29.01.2009 null null null 16.03.2009 null 500200003822 02.04.2009 4500938560 10 5242297 30.04.2009 4500938560_10 500200003823 02.04.2009 4500938560 10 5242297 30.04.2009 4500938560_10 500200003821 02.04.2009 4500938560 10 5242297 30.04.2009 4500938560_10 500200003817 07.04.2009 4500938601 20 5329680 26.05.2009 4500938601_20 500200003831 14.04.2009 4500972967 null 5206715 08.05.2009 null 500200003835 16.04.2009 4500939094 10 5293393 02.06.2009 4500939094_10 500200003833 16.04.2009 4500939094 20 5293393 02.06.2009 4500939094_20 500200003862 27.04.2009 4500938263 10 5213260 24.06.2009 4500938263_10 500200003868 05.05.2009 4500938266 10 5213260 28.08.2009 4500938266_10 500200003869 05.05.2009 4500937870 110 5206880 02.06.2009 4500937870_110 500200003866 05.05.2009 4500939024 140 5242297 23.07.2009 4500939024_140 500200003870 06.05.2009 4500938075 50 5250261 14.05.2009 4500938075_50 500200003877 08.05.2009 4500952739 20 5600052 26.06.2009 4500952739_20 500200003878 08.05.2009 4500980970 10 5219868 08.07.2009 4500980970_10 500200003879 12.05.2009 4500979551 10 5605877 23.07.2009 4500979551_10 500200003911 13.05.2009 4500938045 110 5305799 10.06.2009 4500938045_110 500200003913 13.05.2009 4500938045 130 5305799 null 4500938045_130 - Ashish_Mathur
Super User
Hi,
To start with, you should create a Calendar Table. Create a relationship (Many to One and Single) from the Date column of both Fact Tables to the Date column of the Calendar Table. Create calculated column formulas for Year, Month name and Month number. Sort the Month name column by the Month number. To any visual, drag Year/Month name/Date from the Calendar Table.
- ryan_mayu
Super User
you can do that to make a flag or do something in DAX. Then what's the expected output based on the sample data you provided?