March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello and Happy Friday!
I am trying to recreate a Excel report in Power BI and I am almost there but I am having trouble with 2 calculations and how to convert the syntax that is in Excel over to Power BI DAX.
The Excel report uses a COUNTIF vs something like -
Suggestions?
Solved! Go to Solution.
Hi @Anonymous
You may try to use FIND function to get the two columns.For example:
Column = CALCULATE ( COUNTROWS ( 'Sample' ), FILTER ( ALLEXCEPT ( 'Sample', 'Sample'[TechName] ), FIND ( "Exists in both GoCanvas and e-automate", 'Sample'[TechMatch], 1, 0 ) > 0 && FIND ( "MAC", 'Sample'[MAC?], 1, 0 ) > 0 && FIND ( "Exist", 'Sample'[MAC?], 1, 0 ) > 0 ) )
Column 2 = CALCULATE ( COUNTROWS ( 'Sample' ), FILTER ( ALLEXCEPT ( 'Sample', 'Sample'[TechName] ), FIND ( "Exists in both GoCanvas and e-automate", 'Sample'[TechMatch], 1, 0 ) > 0 || FIND ( "e-automate Only,not in GoCanvas", 'Sample'[TechMatch], 1, 0 ) > 0 ) )
Regards,
Hi @Anonymous
You may try to use FIND function to get the two columns.For example:
Column = CALCULATE ( COUNTROWS ( 'Sample' ), FILTER ( ALLEXCEPT ( 'Sample', 'Sample'[TechName] ), FIND ( "Exists in both GoCanvas and e-automate", 'Sample'[TechMatch], 1, 0 ) > 0 && FIND ( "MAC", 'Sample'[MAC?], 1, 0 ) > 0 && FIND ( "Exist", 'Sample'[MAC?], 1, 0 ) > 0 ) )
Column 2 = CALCULATE ( COUNTROWS ( 'Sample' ), FILTER ( ALLEXCEPT ( 'Sample', 'Sample'[TechName] ), FIND ( "Exists in both GoCanvas and e-automate", 'Sample'[TechMatch], 1, 0 ) > 0 || FIND ( "e-automate Only,not in GoCanvas", 'Sample'[TechMatch], 1, 0 ) > 0 ) )
Regards,
Here is what I ended up with that seems to get me what I needed.
Thank you so much!
AWESOME!!
One last question, where would I add an ELSE to return 0 so that the field is populated with a value?
Thank you SO MUCH!!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
128 | |
90 | |
75 | |
56 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |