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
MichaelSamiotis
Frequent Visitor

Calculate table does not work with fact table's date column

Hello everyone.

 

I have the below DAX formula which works perfectly but when I replace the 'Dim Dates'[Date] with 'Fact Sales'[Date] it only returns blank. I can't get why as I have a one-to-many between those two tables on the Date column.

 

Test =

VAR FilteredSales =
    DISTINCT (
        CALCULATETABLE (
            SELECTCOLUMNS (
                'Fact Sales',
                "Column 1", [Column 1],
                "Column 2", [Column 2],
                "Column 3", [Column 3]
            ),
            LEFT (
                'Fact Sales'[Code],
                1
            ) = "R",
            'Dim Dates'[Date]
                >= DATEVALUE ( "01/01/2020" ),
            'Dim Dates'[Date]
                <= DATEVALUE ( "31/12/2020" ),
            NOT (
                ISBLANK ( 'Fact Sales'[Column 1] )
            )
        )
    )
 
Thank you!
1 REPLY 1
MichaelSamiotis
Frequent Visitor

Forgot to mention that I end this formula with:

RETURN
COUNTROWS(FilteredSales )

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.