Forum Discussion

pbi_data's avatar
pbi_data
Frequent Visitor
3 years ago
Solved

DAX measure

Hi,   I need some help.   I have a measure that takes the max of the products for each customer. products per customer = CALCULATE(MAX('Table'[products_per_customer]))   But I want my measure ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi pbi_data ,

    Please try below steps:
    1. below is my test table

    Table:

    2. create a measure with below dax formula

    Measure =
    VAR cur_date =
        SELECTEDVALUE ( 'Table'[Date] )
    VAR cur_year =
        YEAR ( cur_date )
    VAR cur_month =
        MONTH ( cur_date )
    VAR tmp =
        FILTER (
            ALL ( 'Table' ),
            YEAR ( [Date] ) = cur_year
                && MONTH ( [Date] ) = cur_month
        )
    RETURN
        MAXX ( tmp, [Products] )
    

    3. add a table visual with table fields and measure

    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.