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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Measure not Filtering Calculation

Hi people, I'm just hitting against a wall with this one. 

 

I have a calculate function in DAX where I want to sum a column:

 

Soldadura =
CALCULATE (
    SUM ( WM[Diámetro Neto] ),
    FILTER ( WM, WM[FECHA SOLDADURA (UNION)] > [Fecha Corte Media] )
)

 

Where

- [Diámetro Neto] and [FECHA SOLDADURA (UNION)] are columns in my fact table, first one format is a number and the 2nd one is a date

- [Fecha Corte Media] is a measure from a Date minus a parameter which is a integer

 

The above expresion does the sum, but it is not filtering so I get the total, and I don't know why

 

If I substitute [Fecha Corte Media] by a DATE(YYYY,MM,DD), it works fine, also, a very similar expresion in a different table works fine:

 

 

Festivos desde Corte =
CALCULATE (
    COUNT ( Festivos[Festivos] ),
    FILTER (
        Festivos,
        Festivos[Festivos] > [Fecha Corte Media]
            && Festivos[Festivos] <= [Fecha Actualización]
    )
)

 

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

According to your description, I create a sample and the result works fine,  I think it is possible that the type and writing of the measure “Fecha Corte Media” cause your problem.

vkalyjmsft_0-1635833452827.png

 

vkalyjmsft_1-1635833452834.png

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

According to your description, I create a sample and the result works fine,  I think it is possible that the type and writing of the measure “Fecha Corte Media” cause your problem.

vkalyjmsft_0-1635833452827.png

 

vkalyjmsft_1-1635833452834.png

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Actually, I modify the DB structure to simplify it and now it works. I was making a mistake, probably because the relationship between the data and where the measuere was coming from.

Fowmy
Super User
Super User

@Anonymous 

Not enough information about the model and the calculation, check your relationships and the current filter context where you are running this measure. Can you try the following version? 

Soldadura =
var __fecha = [Fecha Corte Media]
Return
CALCULATE (
    SUM ( WM[Diámetro Neto] ),
    WM[FECHA SOLDADURA (UNION)] > __fecha 
)

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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