Search code examples
filterpowerbidaxvlookup

how to VLOOKUP a measure result in DAX Power BI


i have Excel Dashboard like this enter image description here

i want to replicate this in PBI but the result is not the same enter image description here

in my PBI measure, the Total SKU is

Total SKU = CALCULATE( DISTINCTCOUNT(CSDPVSXML[ProductId]), 
                                    ALL('DT Active'), NOT( ISBLANK(CSDPVSXML[ProductId])))

Total SKU 2 = CALCULATE( DISTINCTCOUNT(CSDPVSXML[ProductId]), NOT( ISBLANK(CSDPVSXML[ProductId])))

Total SKU XML 2 using the same DAX script as Total SKU, is there a way to achieve the same result as the excel version, since i cant vlookup in PBI into DAX result, lookup function in PBI only lokup into predefined table, not the result of a measure

enter image description here enter image description here enter image description here

thank you in advanced


Solution

  • LookUP is working only with a table, not with a visual. Looking through your question, I assume that you just need to exclude distributor value from filtering. Try this code:

    Total SKU 2 =
        CALCULATE(
            [Total SKU]
            ,ALL(tblName[DISTRIBUTOR])
        )
    

    new measure

    Total SKU 2 =
        CALCULATE(
            [Total SKU]
            ,CSDPVSXML[AreaOfPricing]=SELECTEDVALUE(Customer Hierarky[Format Level 3])
            ,ALL(tblName[DISTRIBUTOR])
        )