Forum Discussion

Malinpetersson's avatar
Malinpetersson
Regular Visitor
4 years ago
Solved

Power BI DAX IN

Hi

 

When I have this formel, see belos, can I found what I need but if I change ,Fakturering[Artikeltyp]  to ,Fakturering[Artikelkod]  

Invoiced Yesterday VAS Maskin =
VAR LastInvoiceDay = [_Last InvoiceDay]
VAR Summa = CALCULATE(SUM('Fakturering'[Belopp]),'Fakturering'[Dag] = LastInvoiceDay,Fakturering[Artikeltyp] IN { 50,51,52,53 })
Return IF(ISBLANK(Summa),0,Summa)
 
 
nvoiced Yesterday VAS Maskin =
VAR LastInvoiceDay = [_Last InvoiceDay]
VAR Summa = CALCULATE(SUM('Fakturering'[Belopp]),'Fakturering'[Dag] = LastInvoiceDay,Fakturering[Artikelkod] IN { 5086,5131,5030})
Return IF(ISBLANK(Summa),0,Summa)
 
Its blank in my reprot, why?
 
Thanks in advanced!
 
/M
 
 
 
 
  • Hi Malinpetersson ,

     

    Difficult to be certain based on the info provided, but the first thing I would check is whether [Artikelkod] is text data type.

    If it is, then your DAX should read:

    Fakturering[Artikelkod] IN {"5086", "5131", "5030"}

     

    Pete

3 Replies

  • Hi Malinpetersson ,

     

    Difficult to be certain based on the info provided, but the first thing I would check is whether [Artikelkod] is text data type.

    If it is, then your DAX should read:

    Fakturering[Artikelkod] IN {"5086", "5131", "5030"}

     

    Pete

  • Hi Pete,

     

    Thanks, yes its text, and I cant change it, can you guide me how to chang it? I tried to mark the column and change to number but I then got an error. Can I change it any other way?

    //Malin

    • BA_Pete's avatar
      BA_Pete
      Super User

      Hi Malinpetersson ,

       

      You don't need to change the data type in the data, you just needto write the DAX how I've shown in my example i.e. with " " around the values.

       

      Pete