Forum Discussion

bnevers's avatar
bnevers
Regular Visitor
6 years ago
Solved

Aggregating Across Common Values

I have timecard data in a PowerBI table that looks like this:   Staff     Project     Hours A          1000          2 A          2000          4 A          3000          2 B          1000     ...
  • AlB's avatar
    6 years ago

    Hi bnevers 

    Try this

    1. Place Table1[Staff] in a table visual 

    2. Place this measure in the visual

    Measure =
    SUMX (
        Table1;
        IF (
            CALCULATE (
                COUNT ( Table1[Project] );
                ALL ( Table1[Hours] );
                FILTER (
                    ALL ( Table1[Staff] );
                    Table1[Staff] <> SELECTEDVALUE ( Table1[Staff] )
                )
            ) <> 0;
            Table1[Hours]
        )
    )
    

     

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Cheers  Datanaut

  • Ashish_Mathur's avatar
    6 years ago

    Hi,

    You may download my PBI file from here.

    Hope this helps.