Home Forums Power Pivot Convert DAX to 'M'

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  tomallan 8 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3590

    KCantor
    Participant
    • Started: 13
    • Replies: 30
    • Total: 43

    I am attempting to use a standard Calculated Column expression in PowerQuery and it keeps giving me an error.

    I am using Year-Week:= [Year]&”-“&FORMAT([Weeknumber],”00”)

    It usually displays something along the lines of 2016-09 and was modified from Rob’s Year-Month column.

    The error seems to focus on the ‘,’ can anyone explain this to me? It works when I add it to a calculated column in PowerPivot. I am assuming that there is a slight formatting issue for PowerQuery that I am unaware of.

    #3595

    tomallan
    Keymaster
    • Started: 0
    • Replies: 417
    • Total: 417

    Hi,

    Power Query speaks “M” not DAX:

    Assuming [Year] and [WeekNumber] are numbers, try:

    = Text.From ( [Year] ) & "-" & Text.PadStart ( Text.From ( [WeekNumber] ), 2, "0" )

    Tom

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Power Pivot’ is closed to new topics and replies.