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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
MichaelSamiotis
Resolver I
Resolver I

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 ACCEPTED SOLUTION
MichaelSamiotis
Resolver I
Resolver I

Forgot to mention that I end this formula with:

RETURN
COUNTROWS(FilteredSales )

View solution in original post

1 REPLY 1
MichaelSamiotis
Resolver I
Resolver I

Forgot to mention that I end this formula with:

RETURN
COUNTROWS(FilteredSales )

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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