Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Problem with splitted WEEKNUM

Hello everyone, I have a problem with the calendar week. I want to make a list of the hours worked per calendar week. If the calendar week is in two months, it will be displayed twice. Logically...
  • v-janeyg-msft's avatar
    5 years ago

    Hi, Anonymous 

     

    It’s my pleasure to answer for you.

    According to your description,I think you can create a column, then use it in X axis.

    Like this:

    measure =
    VAR a =
        CALCULATE (
            DISTINCTCOUNT ( Table[Jahr] ),
            FILTER (
                ALL ( Table ),
                [Jahr] = EARLIER ( Table[Jahr] )
                    && [Kalenderwoche] = EARLIER ( Table[Kalenderwoche] )
            )
        )
    VAR b =
        CONCATENATEX (
            CALCULATETABLE (
                DISTINCT ( table[Monat] ),
                FILTER (
                    ALL ( Table ),
                    [Jahr] = EARLIER ( Table[Jahr] )
                        && [Kalenderwoche] = EARLIER ( Table[Kalenderwoche] )
                )
            ),
            table[Monat],
            "+"
        )
    RETURN
        IF ( a > 1, [Jahr] & b & [Kalenderwoche], [Jahr] & [Monat] & [Kalenderwoche] )

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

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