Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

DAX help

Hi all, I have metadatas_ column which is like in below format {"v":[{"v":{"f":[{"v":"40187"},{"v":"life"},{"v":[{"v":{"f":[{"v":"en"},{"v":"Learn"}]}}]},{"v":[]}]}},{"v":{"f":[{"v":"57236"},...
  • ryan_mayu's avatar
    3 years ago

    Anonymous 

    maybe you can try this

    Column = 
    VAR _c=if(SEARCH("China",'Table'[metadatas],1,0)>0,1,0)
    VAR _ee=if(SEARCH("Enlarged Europe",'Table'[metadatas],1,0)>0,1,0)
    VAR iap=if(SEARCH("India and Asia Pacific",'Table'[metadatas],1,0)>0,1,0)
    VAR mea=if(SEARCH("Middle East & Africa",'Table'[metadatas],1,0)>0,1,0)
    VAR na=if(SEARCH("North America",'Table'[metadatas],1,0)>0,1,0)
    VAR sa=if(SEARCH("South America",'Table'[metadatas],1,0)>0,1,0)
    var g=if(SEARCH("Globe",'Table'[metadatas],1,0)>0,1,0)
    return if(g=1,"Globe",if(_c+_ee+iap+mea+na+sa>1,"Locality",if(_c+_ee+iap+mea+na+sa=1,"Region")))