Forum Discussion

David4's avatar
David4
Frequent Visitor
8 years ago
Solved

Summarize Date table while keeping Day selections

Hi   I posted a question which was answered in the link below but I'm trying to refine it and am getting stuck   http://community.powerbi.com/t5/Desktop/Identifying-Period-number-from-Week-number...
  • v-juanli-msft's avatar
    v-juanli-msft
    8 years ago

    Hi David4

    With this measure I can get the result as your example.

    Measure 4 =
    CALCULATE (
        SUM ( GP[GP] ),
        FILTER (
            ALLSELECTED ( Dates ),
            'Dates'[Period] = MAX ( 'Dates'[Period] )
                && 'Dates'[Week] <= MAX ( 'Dates'[Week] )
                && 'Dates'[Day] = MAX ( 'Dates'[Day] )
        )
    )

    Best Regards

    Maggie

  • David4's avatar
    David4
    8 years ago

    Thanks Maggie - I've tweaked your measure slightly so that the totals work:

     

    Measure 5 = 
    CALCULATE (
        SUM ( GP[GP] ),
        FILTER (
            ALLSELECTED ( Dates ),
            'Dates'[Period] = MAX ( 'Dates'[Period] )
                && 'Dates'[Week] <= MAX ( 'Dates'[Week] )
        ),
        VALUES(Dates[Day])
    )

    Thanks so much for your help with this