Forum Discussion

HugoTran's avatar
HugoTran
Frequent Visitor
2 years ago
Solved

Filter Power BI Dax based on condition

Hi All - 

 

I am trying to filter a table base on the following condition (Status=New, SME group is not populated (blank)) but it came back with error " A single value for column [] in table [] can not be determined. This can happen when a measure formula rfers to column that contain many values without specifying aggreation..." I am new with this and any help are greatly appreciated. Thank you in advance!

 

 

  • Hi, HugoTran 

     

    filtercondition =

    If( min(tablename[status])="new" || min(tablename[sme group assigned])<>blank(),"filter","not filter")

12 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HugoTran  You'll need to use an aggregation function in those cases (like MAX), or you can try using the FIRSTNONBLANK function with your example.

     
    • HugoTran's avatar
      HugoTran
      Frequent Visitor

      Thank you for the quick reply. when I added the MAX aggr function, I get the following error.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        HugoTran  I edited my initial response. Try FIRSTNONBLANK with your example.

  • Dangar332's avatar
    Dangar332
    Icon for Resident Rockstar rankResident Rockstar

    hi, HugoTran 

    when you use measure you need aggegation functions like sum(), min(), max(),....

     

    try like below

     

    filtercondition =
     min(tablename[status])="new" || min(tablename[sme group assigned])<>blank(),"filter","not filter")

    • HugoTran's avatar
      HugoTran
      Frequent Visitor

      Thanks for the help. When I update the agg function to MIN, I got error "Too many arguemtns were passed to the FIRSTNONBLANK funciton. The maximum argument count for the function is 2."