Forum Discussion

EmilyM2019's avatar
EmilyM2019
Helper II
6 years ago
Solved

DAX calulation help for identifying blank values

Hello all,

I am new to Power BI and need some help please.

I'm looking for a DAX calculation to help me identify where a marker hasn't been added to a case. See table below where I have my columns Case ID, Case category and Marker. In this example the case categories Performance and Contract should also have a Marker but they don't. My Case category Pay doesn't need a marker.

What I think I want is a new column that looks to see if there is a marker, if there isn't it looks to see what the case category is, then based on that information it creates a flag in a new column to identify a case category that should have a flag doesn't have one.

I hope that makes sense. Any help would be much appreciated.

Regards,

 

Emily.

  • Hi EmilyM2019 ,
    Go to Power Query, go to Add Column tab, Conditional Column and add along the lines below. You can put in multiple statements.
    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
    Nathaniel

     

13 Replies

  • Nathaniel_C's avatar
    Nathaniel_C
    Community Champion

    Hi EmilyM2019 ,
    Go to Power Query, go to Add Column tab, Conditional Column and add along the lines below. You can put in multiple statements.
    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
    Nathaniel

     

    • EmilyM2019's avatar
      EmilyM2019
      Helper II

      Nathaniel_C  Thanks I will give this a go. Although the fact that I can't even post a table into this message thread doesn't fill me with much hope 😉 

      • Nathaniel_C's avatar
        Nathaniel_C
        Community Champion

        Hi EmilyM2019 ,

        Try copy and paste. Below I copied this table from Power BI and pasted here. It makes it easy for your forum helpers to copy and paste into their enter data in Power BI.


        Let me know if you have any questions.

        If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
        Nathaniel


        OrderMetric AHighest Metric Same Order

        beta 421012
        beta 421212
        beta 711117
        beta 711717
        Delta 1012121
        Delta 101521
        Delta 101621
        Alpha 1021015
        Alpha 1021215
        Alpha 1021515
        Alpha 102315
        Alpha 102715
        ETA 521014
        ETA 521214
        ETA 521414
        ETA 52514
        ETA 52614
    • EmilyM2019's avatar
      EmilyM2019
      Helper II

      I ended up using the conditional column solution to identify the need for a marker. 

       

      I then did nested IF to identify where there should be a marker but there wasn't one.

       

      Thanks for all the help.

  • You could also do an added column in the modeling tab (not in Power Query) using DAX like this:

     

     

    New Marker = 
    IF(
        OR(TableName[CaseCategory] = "Performance", TableName[CaseCategory] = "Contract") = TRUE,
        "Yes",
        TableName[Marker])

     

    This simply checks to see if the Case Category is one of the two values required. If so, it returns "Yes". If not, it defaults to whatever the current Marker is.

     

    If you want to do it in the Query Editor, you can do as Nathaniel suggested and then merge the columns to get a single value.

    • Nathaniel_C's avatar
      Nathaniel_C
      Community Champion

      Hi JonV ,

      However, less of a performance hit when you use Power Query over a calculated column.

      Nathaniel

  • v-lid-msft's avatar
    v-lid-msft
    Community Support

    Hi EmilyM2019 ,


    How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?

     

    Best regards,

    Community Support Team _ Dong Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.