Home Forums Power Pivot Multiple IFs in DAX

This topic contains 3 replies, has 3 voices, and was last updated by  DarioKeizer 1 day, 10 hours ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #10592

    DarioKeizer
    Participant
    • Started: 1
    • Replies: 1
    • Total: 2

    Hi Everyone,

    I am busy migrating all my department’s reports to PowerPivot using DAX.

    In one of the reports I use a function with multiple IFs so that:
    – for each row containing a number, the corresponding word (e.g. X-Large, Large, Medium) is returned.

    Does anybody know which DAX expression(s) I can use to achieve this. I was thinking about calculate in combination with count…but didn’t achieve the result just yet.

     

    Attachments:
    You must be logged in to view attached files.
    #10595

    jhd
    Participant
    • Started: 1
    • Replies: 5
    • Total: 6
    #10649

    infinitex86
    Participant
    • Started: 3
    • Replies: 4
    • Total: 7

    As jhd pointed out — SWITCH is the way to go. Much more readable than nested IF statements.

    To rewrite your formula in DAX, simply use:
    = SWITCH([Column B], 1, “XLarge”, 2, “Large”, etc, etc)

    #10661

    DarioKeizer
    Participant
    • Started: 1
    • Replies: 1
    • Total: 2

    Hey jhd and infinitex86,

    Thanks for your answers. This was exactly the solution I was looking for,

    Gr.

    Dario

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

You must be logged in to reply to this topic.