Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Malinpetersson
Regular Visitor

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
 
 
 
 
1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

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



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

3 REPLIES 3
Malinpetersson
Regular Visitor

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

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



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




BA_Pete
Super User
Super User

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



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.