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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DAX Measure from Excel Formula

Hi,

Would someone know how I can convert my Excel formula to DAX? It's already 2 weeks, I tried every COUNT formula in PowerBI but no luck. Any suggestion is appreciated. Thank you!

 

=COUNTIFS('Scorecard-All'!H:H,">3%",C:C,">00:02:00",'Scorecard-All'!J:J,M2)/COUNTIF('Scorecard-All'!J:J, M2)

 

TechNewbie1_1-1597055126586.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , it would something like

countx('Scorecard-All', if('Scorecard-All' [H]>.03 && 'Scorecard-All'[C] > time(,2,0)),'Scorecard-All'[J] )/count('Scorecard-All'[J] )

 

Can you share sample data and sample output in table format?

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@Anonymous  - You may find this helpful:

 

https://community.powerbi.com/t5/Community-Blog/Excel-to-DAX-Translation/ba-p/1060991

 

You generally replace COUNTIF with a COUNTX statement or a CALCULATE statement.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@Anonymous , it would something like

countx('Scorecard-All', if('Scorecard-All' [H]>.03 && 'Scorecard-All'[C] > time(,2,0)),'Scorecard-All'[J] )/count('Scorecard-All'[J] )

 

Can you share sample data and sample output in table format?

Anonymous
Not applicable

Hi @amitchandak,

 

Thanks for this! I will try it and let you know! Below is the sample data that I am using to compute the "Buffering > 3% of viewing duration" column.

 

Sample Output:

CountryBuffering > 3% of viewing duration 
Canada4.62%

-------------------------------

Sample Data:

Sum of Buffering% bufferingCountry
0:00:021%Canada
0:09:5017%Canada
0:00:010%Canada
0:00:010%Canada
0:03:0526%Canada
0:00:010%Canada
0:00:170%Canada
0:00:040%Canada
0:00:010%Canada
0:00:010%Canada
0:00:010%Canada
0:02:578%Canada
0:00:010%Canada
0:00:010%Canada
0:00:010%Canada
0:00:000%Canada
0:00:020%Canada
0:00:020%Canada
0:00:000%Canada
0:00:010%Canada
0:00:110%Canada
0:00:140%Canada
0:00:030%Canada
0:00:050%Canada
0:00:020%Canada
0:00:000%Canada
0:00:010%Canada
0:00:010%Canada
0:00:000%Canada
0:00:010%Canada
0:00:010%Canada
0:00:000%Canada
0:00:010%Canada
0:00:070%Canada
0:00:010%Canada
0:00:000%Canada
0:00:020%Canada
0:00:021%Canada
0:00:010%Canada
0:01:133%Canada
0:00:130%Canada
0:01:064%Canada
0:00:000%Canada
0:00:010%Canada
0:00:030%Canada
0:00:000%Canada
0:00:211%Canada
0:00:130%Canada
0:00:211%Canada
0:00:010%Canada
0:00:010%Canada
0:00:250%Canada
0:00:040%Canada
0:00:511%Canada
0:00:311%Canada
0:00:210%Canada
0:00:101%Canada
0:01:556%Canada
0:00:040%Canada
0:02:182%Canada
0:00:270%Canada
0:00:030%Canada
0:01:131%Canada
0:00:010%Canada
0:00:020%Canada
Fowmy
Super User
Super User

@Anonymous 

To make it quick and easy, upload your data on to Power BI and make sure your data is properly organized. Then, show the column names and the expected output

____________________________________
How to paste sample data with your question?
How to get your questions answered quickly?

_____________________________________
Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn


________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors