Forum Discussion

CiccioST's avatar
CiccioST
New Member
8 years ago
Solved

Dynamic Counting based on value range

Dears, I am a new  POWER BI user and I am trying to figure the best way to do things currently done with Pivot tables and excel in general. only basic knowledge of DAX language.   I have a huge a...
  • v-yulgu-msft's avatar
    8 years ago

    Hi CiccioST,

     

    Add a calculated column in data table.

    buying category =
    IF (
        CALCULATE (
            SUM ( 'Customer purchase'[Value] ),
            ALLEXCEPT (
                'Customer purchase',
                'Customer purchase'[Customer Name],
                'Customer purchase'[Month]
            )
        )
            < 300,
        "Buying<300",
        "Buying>300"
    )

    Use a Matrix to display data, add [Customer Name] to "values" section, choose "Count(distinct)".

    Best regards,

    Yuliana Gu