Forum Discussion

BChinya's avatar
BChinya
Frequent Visitor
3 years ago
Solved

Sumx is not working with iterative condition

Hi, Problem statement trying to address : I have a dataset that have people and ther age. I am trying to count the number of people based on the dynamic bin(X axis) that i have created using numeric...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi BChinya ,

    Please try:

    Number of subjects within = 
    VAR _Binsize_min =
        SELECTEDVALUE ( 'Bin Start'[Bin Start] )
    VAR _binsize_end =
        _Binsize_min + SELECTEDVALUE ( 'Bin Size'[Bin Size] )
    VAR _subnr =
        CALCULATE (
            COUNTROWS ( DM ),
            'DM'[Age] >= _Binsize_min
                && 'DM'[Age] < _binsize_end,
            ALLSELECTED ( 'DM'[Subject] )
        )
    RETURN
        _subnr

    Output:

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum