cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
maxanatsko
Regular Visitor

Recreate Excel formula with COUNTIF and MATCH

Hi there.

 

Is it possible to reproduce this formula from Excel in DAX somehow?

=if(countif(offset(B12;0;2;1;IFERROR(MATCH("No";E12:G12;0);9999));"No") >= 2;"Accepted";if(countif(offset(B12;0;2;1;IFERROR(MATCH("No";E12:G12;0);9999));"Yes") > 0;"In Progress";if(A12=9999;"In Progress";"Fix Required")))

 

Source data looks like this:

GradeStateTest Case IDTest Case ID (2)Test Name / Date04.03.201728.02.2017
2Fix Required288145898667Test Name 2NoYes
9999Accepted277857678656Test Name 2YesYes

 

And in pBI its unpivoted and transformed to look like:

ID - Test Name - Date - State

 

*Notice that dates order is left to right. New ones are going to end up at the left side.

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @maxanatsko,

 

You formula seems not match to your data, can you share the available sample data?

 

In addition, power bi contains the if and iferror function, you can simply convert them, but I haven't found the function which function match the offset function. 

 

For countif and match, you can try to use countax and search function.

 

Reference link: 

DAX Function Reference

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Here is an original data - doc

Hi @maxanatsko,

 

I can't find the function to replace the offset function, perhaps you can calculate in excel then get the result data to power bi.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
ibarrau
Super User
Super User

I'm no excel expert at all, but I pretty sure that countif, match, iferror and if exists in DAX with similar names. You should get to know the basics with powerbi check. 
It is so powerfull that i think you will success. Maybe the solution won't be the hole formula because you can relate tables and mix things in the visualizations, but would be possible.

 


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors