Forum Discussion

T_JF2022's avatar
T_JF2022
Frequent Visitor
4 years ago
Solved

Correct Calculate

I've some problems to calculate the correct value.   Context - Every month i receive a report with a list of employees with the column Name, UniqID, CostCenter, FTE & Report Date. Unfortunately, th...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi T_JF2022 ,

    Since you did not give a specific table, I had to create my own table for testing according to your description, please point out if there are any problems.

    Please try below steps:

    1. below is my test table

    Table:

    Table2:

     

    Table 2 =
    CALENDAR ( FIRSTDATE ( 'Table'[Date] ), LASTDATE ( 'Table'[Date] ) )
    

     

    2. create a measure and add it to card visual

     

    Measure =
    VAR max_date =
        MAXX ( ALL ( 'Table 2' ), 'Table 2'[Date] )
    VAR tmp =
        FILTER (
            ALL ( 'Table' ),
            'Table'[Cost Center] <> BLANK ()
                && 'Table'[FTE&Report ] <> BLANK ()
                && 'Table'[Date] = max_date
        )
    RETURN
        COUNTROWS ( tmp )
    

     

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_ Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.