Forum Discussion

NebojsaZ88's avatar
NebojsaZ88
Frequent Visitor
3 years ago
Solved

How to calculate higher value for same dates on user level

Hi all, I need to solve problem below presented: I am trying to calculate count of rows by unique users but problem is when user appears two or more times in same week. In example below, in #2 group...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi NebojsaZ88 ,

    Please refer to my pbix file to see if it helps you.

    Create measures.

    Measure =
    IF (
        MAX ( [Group rank] )
            = CALCULATE (
                MAX ( 'Table'[Group rank] ),
                FILTER ( ALL ( 'Table' ), [weekending] = SELECTEDVALUE ( 'Table'[weekending] ) )
            ),
        1,
        0
    )
    
    Measure2 =
    VAR _b =
        SUMMARIZE ( 'Table', 'Table'[weekending], "aaa", [Measure] )
    RETURN
        IF ( HASONEVALUE ( 'Table'[weekending] ), [Measure], SUMX ( _b, [aaa] ) )
    

     Or create a column.

    Column =
    IF (
        [Group rank]
            = CALCULATE (
                MAX ( 'Table'[Group rank] ),
                FILTER ( 'Table', [weekending] = EARLIER ( 'Table'[weekending] ) )
            ),
        1,
        0
    )
    

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Polly

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