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

Avoid filter other Tables

Hi,

When I calculate cumulative progress, it is 0.25 percent greater than total due to the relationship between the date dimension table and the other two tables. The outcome is satisfactory when I disable the relationship with the 3Dmodel table.

How can a filter be applied only to the date table using DAX?

 

Overall_Total Actual Prgrs =
[Overall_Eng_Actual_Prgrs]+[Overall_3Dmodel_Actual_prgrs]+[Overall_Benchmark_Actual_prgrs]

 

Overall_Actual_Cumulative_Prgrs =
CALCULATE (
[Overall_Total Actual Prgrs],
FILTER (
ALLSELECTED ( 'DIM Calendar' ),
'DIM Calendar'[Date]
<= MAXX( FILTER( 'DIM Calendar',
'DIM Calendar'[Date] <= TODAY()),
'DIM Calendar'[Date])
)
)

 

Result when relationship is active 

ajisharavind_99_0-1663857870288.png

Data Model

ajisharavind_99_1-1663857951007.png

 

1 ACCEPTED SOLUTION

Try

Overall_Actual_Cumulative_Prgrs =
VAR MaxDate =
    CALCULATE ( MAX ( 'DIM Calendar'[Date] ), 'DIM Calendar'[Date] <= TODAY () )
RETURN
    CALCULATE (
        [Overall_Total Actual Prgrs],
        ALLSELECTED ( 'DIM Calendar' ),
        'DIM Calendar'[Date] <= MaxDate
    )

View solution in original post

4 REPLIES 4
johnt75
Super User
Super User

Change the relationships from the date table to all the other tables to be one-to-many single-direction relationships.

@johnt75 Still same

Try

Overall_Actual_Cumulative_Prgrs =
VAR MaxDate =
    CALCULATE ( MAX ( 'DIM Calendar'[Date] ), 'DIM Calendar'[Date] <= TODAY () )
RETURN
    CALCULATE (
        [Overall_Total Actual Prgrs],
        ALLSELECTED ( 'DIM Calendar' ),
        'DIM Calendar'[Date] <= MaxDate
    )

My budget calculation was the problem. When I applied for the cumulative as of today, it was also filtering budget. I removed the filter (REMOVEFILTERS), and the problem has been resolved.
I appreciate your response

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.

Top Solution Authors