I have two tables.
Fact:
Date | Value |
---|---|
2021-10-21 | 1 |
2021-10-23 | 2 |
2021-10-26 | 3 |
Dim:
Date |
---|
2021-10-19 |
2021-10-20 |
2021-10-21 |
2021-10-22 |
2021-10-23 |
2021-10-24 |
2021-10-25 |
2021-10-26 |
2021-10-27 |
2021-10-28 |
fact_start_date = minx(all(Fact), Fact[Date])
fact_end_date = maxx(all(Fact), Fact[Date])
I want to write measure in Fact table that the result is the following table.
ِDim table Dates are between fact_start_date and fact_end_date of Fact table and empty values are replaced with zero.
notes:
1.write measure in Fact table
2.use measure, not new table
result:
(select Date from Dim)
Date | measure |
---|---|
2021-10-21 | 1 |
2021-10-22 | 0 |
2021-10-23 | 2 |
2021-10-24 | 0 |
2021-10-25 | 0 |
2021-10-26 | 3 |
thanks