How to COUNT in Power BI // COUNT, COUNTA, DISTINCTCOUNT, COUNTBLANK, COUNTROWS, COUNTX, COUNTAX

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 มิ.ย. 2024
  • In this video I go through the SEVEN different ways you can count using DAX in Power BI.
    Counting is probably one of the most common functions you would've been using if you work a lot of with data. Did you know that you can do more with your COUNTS in Power BI?
    Here's a TLDR version of the video if you don't want to watch the whole thing:
    - COUNT - Count Non-Blank Values
    - COUNTA - Count Non-Blank Values, accepts TRUE/FALSE types
    - DISTINCTCOUNT - Count unique values
    - COUNTBLANK - Counts blank rows
    - COUNTROWS - Counts rows in table
    - COUNTX - Count rows with expression (like Filters)
    - COUNTAX - Count rows with expression, accepts TRUE/FALSE types
    -
    Get started with Power BI Desktop FREE
    powerbi.microsoft.com/en-us/d...
    Generate mock data with Mockaroo
    www.mockaroo.com/
    SUM and SUMX in Power BI
    • How to use SUM and SUM...
    AVERAGE and AVERAGEX in Power BI
    • How to use AVERAGE, AV...
    -
    🚩 Support us to get perks such as demo files, early access and more!
    / solutionsabroad
    MY FAVOURITE POWER BI BOOKS
    📕 The Definitive Guide to DAX - amzn.to/3ruYs2f
    📗 DAX Patterns - amzn.to/3oVgOYs
    MY GEAR
    🎥 Canon 4000D DSLR Camera - amzn.to/3tCqDOw
    💻 Cyberpower Wyvern PC - amzn.to/3q04QOw
    🪑 Infamous Gaming Chair - amzn.to/3q3iUXw
    💡 LED Studio Lighting - amzn.to/3q3ftQz
    🎙 Lavalier Microphone - amzn.to/3jwKutG
    📺 Monitor - amzn.to/2LuHhhO
    GET IN TOUCH
    📺 Website - www.solutionsabroad.co.uk
    📧 Email me - fernan@solutionsabroad.co.uk
    🤵 LinkedIn - / solutionsabroad
    📘 Facebook - / solutionsabroad
    📸 Instagram - / solutions_abroad
    🐤 Twitter - / abroadsolutions
    🤖 Reddit - / fernanespejo
    🌍 WHO IS SOLUTIONS ABROAD
    Hi, my name is Fernan, the one-man band of Solutions Abroad. I work as a Data Scientist based in London, UK and have over 6 years of experience working in Business Intelligence. Solutions Abroad these days is dedicated to teaching the ins and outs of Power BI, through the power of TH-cam.
    If you want to learn more, I’ve conveniently created playlists to help you find the right topic for you.
    🐎 First, watch this video about how a typical Power BI workflow looks like
    • Power BI from START to...
    🗺 Learn DAX to extend your Power BI calculations
    • Power BI DAX Basics OLD
    📆 Stay up-to-date on all the features Power BI releases monthly
    • Power BI Monthly Featu...
    🧪 Get certified as a Microsoft Data Analyst Associate
    • Power BI DA 100 Prepar...
    💡 Learn Power BI Features to improve your dashboards
    • Power BI Feature Highl...
    📊 WHAT IS POWER BI?
    Power BI is a business analytics tool by Microsoft. It creates a working environment suited for normal users, meaning tasks such as data extraction, cleansing, analysis and storytelling; these are made easily-accessible to citizen-users, and extendable for technical users. At face value it provides visually-stunning, interactive dashboards, but it’s built on top of so much more.
    🔻 Get started with Power BI Desktop for FREE
    powerbi.microsoft.com/en-us/d...
    #PowerBI #DataAnalytics #BusinessIntelligence

ความคิดเห็น • 111

  • @sixtyfiveroses2968
    @sixtyfiveroses2968 2 ปีที่แล้ว +7

    Perfect explanation, just what I was looking for! I've watched many videos, but no one explains it the way you did. Thank you again! Subscribed.

    • @SolutionsAbroad
      @SolutionsAbroad  2 ปีที่แล้ว

      Glad it helped! Thanks for watching and the for the sub!

  • @EMKworks
    @EMKworks 3 ปีที่แล้ว

    Excellent layered 10 minute video, being able to see the table and the counted numbers on the one page seriously good idea. Well done!

    • @SolutionsAbroad
      @SolutionsAbroad  3 ปีที่แล้ว

      Glad you liked it, thanks for watching!

  • @matthewshotton86
    @matthewshotton86 9 หลายเดือนก่อน

    Amazingly explained for the refresher I needed, thanks for all the great content!

  • @faizaa5476
    @faizaa5476 3 หลายเดือนก่อน

    Such a good video, slowly starting to become a pro on power bi. THANK YOU SO MUCH!

  • @kunjal96
    @kunjal96 2 ปีที่แล้ว

    Perfect and practical explanation about the count function !!! Thank you brother

  • @bouldy7
    @bouldy7 19 วันที่ผ่านมา

    Thank you for the Countx Filter measure! Hero

  • @jbmh9339
    @jbmh9339 ปีที่แล้ว

    This is awesome! Your videos helps me a lot!

  • @mayanknema3007
    @mayanknema3007 ปีที่แล้ว

    Awesome explanation. You cant get better than this on this topic.

  • @ibrahimburhankonuk
    @ibrahimburhankonuk ปีที่แล้ว

    Perfect explanation, worth to watch for every sec.

  • @gnavarrolema
    @gnavarrolema 2 ปีที่แล้ว

    Great explanation...it is much clear to me how to use these functions. Thanks.

  • @user-hz6gw3uk6z
    @user-hz6gw3uk6z 4 หลายเดือนก่อน

    very clearly explained. Thank you!

  • @VeganSmasher
    @VeganSmasher 2 ปีที่แล้ว +1

    Fantastic video. Thank you!

  • @chinmayjoshi977
    @chinmayjoshi977 ปีที่แล้ว

    thanks for the video! super helpful

  • @yonwabangwenze2251
    @yonwabangwenze2251 3 ปีที่แล้ว +2

    This is really helpful. Thanks

    • @SolutionsAbroad
      @SolutionsAbroad  3 ปีที่แล้ว

      Great stuff, thanks for checking it out!

  • @wesleyharper3253
    @wesleyharper3253 ปีที่แล้ว +1

    Worked like a charm!

  • @cazvon4346
    @cazvon4346 ปีที่แล้ว

    Clearly explained supported by simple visuals - makes learning less complicated. One question, why would you not use the COUNTA and COUNTAX functions all the time as they can handle numeric, text and binary strings? Is it a refresh performance issue?
    Thank you.

  • @gbolahanl4280
    @gbolahanl4280 3 ปีที่แล้ว +1

    Thanks for the video. It is very helpful

  • @divyaparekh6721
    @divyaparekh6721 3 ปีที่แล้ว +1

    you explain really well

  • @danielosorio217
    @danielosorio217 ปีที่แล้ว

    Excellent explanations! I'd like to know how to use the functions, particularly using CountX and CountAX to count "text" values (non Boolean) rather than numerical.
    I have a table with vendors/suppliers that deliver different parts. Some of the vendors deliver some of the same parts, so two vendors may have the same Part No..
    Parts per vendor are marked as delivered Early, On-time, and Late. I want to count each of these three delivery statuses per part and vendor to then calculate the percentage of each delivery status per vendor out of the Grand Total of all deliveries and the percentage based on each delivery type/status. For now, this is the formula I came up with to count early deliveries:
    _CountX = COUNTAX(FILTER(Delivery, Delivery[Delivery Type] = Early()), Delivery[Delivery Type])
    Thanks for your help!

  • @letthemknowuncle5399
    @letthemknowuncle5399 ปีที่แล้ว

    Amazing explanation 😁

  • @shyjumathew07
    @shyjumathew07 3 หลายเดือนก่อน

    Good one, thanks

  • @kennethstephani692
    @kennethstephani692 3 ปีที่แล้ว +2

    Great video!

  • @aleksanderstrommer7677
    @aleksanderstrommer7677 3 ปีที่แล้ว +1

    Great example!

  • @great_filter
    @great_filter 2 ปีที่แล้ว +1

    Thank you very much

  • @EngineeredFoodies
    @EngineeredFoodies 2 ปีที่แล้ว

    Hi I am facing issues in the distinct count. When i use column distribution in power bi query editor the value of distinct count is right. But when I tried to calculate the same value for the same column in power bi desktop the value was different. Need your support.

  • @tuncohighway7922
    @tuncohighway7922 2 ปีที่แล้ว

    Excelent video sr!

  • @1985mercedesbenz
    @1985mercedesbenz 2 หลายเดือนก่อน

    thank so much

  • @philipwatuma7120
    @philipwatuma7120 3 ปีที่แล้ว +1

    Very useful thanks

    • @SolutionsAbroad
      @SolutionsAbroad  3 ปีที่แล้ว

      You're welcome, thanks for watching!

  • @thermant8452
    @thermant8452 2 ปีที่แล้ว +1

    Good stuff! Thx!

  • @natynt227
    @natynt227 ปีที่แล้ว

    just perfect tks sir

  • @BSITVinluanEner
    @BSITVinluanEner 9 หลายเดือนก่อน

    Thanks Broooo , loveit

  • @Pasar2490
    @Pasar2490 3 ปีที่แล้ว +3

    Great video! I have a question. Why if we want to count everything in the row except a specific value?

    • @SolutionsAbroad
      @SolutionsAbroad  3 ปีที่แล้ว +1

      Hi Sara, if you want to count everything except a specific value, you'll need to use the CALCULATE function to apply a filter context to your count. From memory, I covered this in a previous video, check it out if you haven't yet
      th-cam.com/video/Sr3OdE-jx_8/w-d-xo.html
      Hope it helps!

  • @anino68
    @anino68 ปีที่แล้ว

    Great explanation.... Maybe you can help me with a matter, I need to count the codes of the clients that are repeated during different years. For example, customer 373 checked in 2020, 2021, 2022 = 3 unique times. Thanks for your help.

  • @user-cf8jx9tf2y
    @user-cf8jx9tf2y 9 หลายเดือนก่อน

    Would you know how to count # of rows based on conditions on calculated measures?
    Measures are based on 2 different tables with one related column.

  • @jevieacop
    @jevieacop ปีที่แล้ว

    Hey Fernan! Thanks for your videos, I've been following you for quite a while now and it helps me a lot in my work related projects. Are you a Filipino?

  • @tllittle
    @tllittle 2 ปีที่แล้ว

    Nice 👍🏽, new subscriber

  • @alejandropatino9095
    @alejandropatino9095 10 หลายเดือนก่อน

    Great!

  • @jaybilakhia5695
    @jaybilakhia5695 2 ปีที่แล้ว +1

    Just saved me >1 Hour
    Thanks

  • @davidgitau8825
    @davidgitau8825 2 ปีที่แล้ว

    MeasureName=CountRows(CalculateTable(Table, Filter1,filter2))--CalculateTable gives you an opportunity return a subset of the table, with rows that meets criteria specified in the filters. Then use countrows to get subset count,

  • @shikhaofficial29
    @shikhaofficial29 2 ปีที่แล้ว +2

    Great video! What if both the columns I am evaluating in the expression “COUNTAX(FILTER(People, People[business_unit] > 1),People[IsManager])” are of text data types?

    • @SolutionsAbroad
      @SolutionsAbroad  2 ปีที่แล้ว

      Hi Shikha, the count should work as long as the values are non blank

  • @baastech7840
    @baastech7840 2 ปีที่แล้ว +1

    perfect man

  • @faizanbhat2626
    @faizanbhat2626 ปีที่แล้ว

    count function calculates blank cells as well for me.

  • @SivaPonakala
    @SivaPonakala ปีที่แล้ว

    Can we show count of null values against each column from a table in a single visualization .. I do not want to use countblank for each column individually.. please suggest

  • @user-ht9ct4ih8p
    @user-ht9ct4ih8p 6 หลายเดือนก่อน

    Why can't we apply the distinct value count to the card visual when I create as measure

  • @agapheputrasusilo741
    @agapheputrasusilo741 3 หลายเดือนก่อน

    THANKSSSSSS

  • @DiCh-jp8ms
    @DiCh-jp8ms ปีที่แล้ว

    Hi i can`t fiure out a problem with counting. I have a table with 5 names of people that are repeated multiple times in the table and next to this column i have another one with a status "Yes" or a blank cell. I want to count only the times that a name apears with a status yes. For example i have John repeated 5 times, 3 of which are with status yes and David repeated 3 times and 2 times are with statu yes. I want to make a table in which to show the names and how many times they have status Yes.

  • @SivaPonakala
    @SivaPonakala ปีที่แล้ว

    how can I show number of null values in each column from a table at a time in a table or matrix visual ? is there a way, Please suggest. ..

  • @MoonShine-bs6cl
    @MoonShine-bs6cl 5 หลายเดือนก่อน

    Hi your teaching is great but how can i avail the pbix demo files which u have used in the videos for practice, please help.

  • @ToniaLNewton
    @ToniaLNewton ปีที่แล้ว

    How does one count how many time a certain value is in that column. As in how many times 10 is listed. I can't get it to work for NPS.

  • @PhillipLearnTeach
    @PhillipLearnTeach 2 ปีที่แล้ว +1

    How do you make a measure or a calculated column that consist of a measure and certain values from a columns from either same table of separate table?

    • @SolutionsAbroad
      @SolutionsAbroad  2 ปีที่แล้ว

      Hi Phillip, measures and calc columns are identical but not similar. Here's a video explaining how they're different: th-cam.com/video/ns4VbpRKAFs/w-d-xo.html
      Measures can reference columns or measures anywhere in the dataset
      Calculated columns is data within a table, if you want to reference columns from other tables, there has to be a relationship that connects those tables together, here's a video on relationships if it helps: th-cam.com/video/OOs-VWf20E8/w-d-xo.html

  • @kayeiaramariedeocampo7980
    @kayeiaramariedeocampo7980 3 ปีที่แล้ว +4

    Great Video! One question, what if I want to count the number of occurence of a specific Order ID?

    • @SolutionsAbroad
      @SolutionsAbroad  3 ปีที่แล้ว +1

      Hi Kaye, great question! You might want to look at using "Group By" on your Order ID, this will give you a count of occurrences for each ID.
      Alternatively, you can also created a calculated column, maybe this will help: community.powerbi.com/t5/Developer/How-to-count-the-occurrences-of-each-value-in-a-column-including/td-p/151328

    • @kayeiaramariedeocampo7980
      @kayeiaramariedeocampo7980 3 ปีที่แล้ว +3

      @@SolutionsAbroad Hi I tried but it keeps removing other columns. How can I retain the existing columns (that is part of the data set, but not a reference for the thing I'm counting) thereafter? For example, I tried creating a counter for a Record ID, after selecting the column, applying Group by, it does give me the column for counter, but deletes automatically the rest of my data set. Can't figure it out. huhu

    • @SolutionsAbroad
      @SolutionsAbroad  3 ปีที่แล้ว +1

      @@kayeiaramariedeocampo7980 Hey Kaye, a quick, non-complicated solution is to just create a duplicate query of this one before the GROUP BY, then merge it back so you can get your other columns.
      The Group By has to exclude the other columns so it can be grouped by ID, hope it helps!

    • @kayeiaramariedeocampo7980
      @kayeiaramariedeocampo7980 3 ปีที่แล้ว +2

      @@SolutionsAbroad Thanks!

    • @SolutionsAbroad
      @SolutionsAbroad  3 ปีที่แล้ว

      @@kayeiaramariedeocampo7980 you're welcome, good luck!

  • @zhengsiyuan5695
    @zhengsiyuan5695 3 ปีที่แล้ว +2

    Great Video! I have a question. How do you put your raw data table here.

    • @SolutionsAbroad
      @SolutionsAbroad  3 ปีที่แล้ว

      Hi Zheng, great question! You need to use the "Get Data" option in the ribbon to import your data into Power BI. Hope that helps!

  • @allaboutfoodzbydebd8627
    @allaboutfoodzbydebd8627 3 ปีที่แล้ว +1

    awesom

  • @giridharnaidu3662
    @giridharnaidu3662 2 ปีที่แล้ว +1

    What are the most common DAX functions used in power bi in real time.. Can u cover a video in this specific topic..

    • @SolutionsAbroad
      @SolutionsAbroad  2 ปีที่แล้ว

      Hey there, thanks for watching! I covered my top 5 DAX functions here: th-cam.com/video/qF9eKJxT5Bg/w-d-xo.html

  • @DashMcunfast
    @DashMcunfast 8 หลายเดือนก่อน

    How are you displaying the data table here? ... Are you just using the table visualisation?

  • @abdulqadeerkamangar6279
    @abdulqadeerkamangar6279 2 ปีที่แล้ว +1

    How can we select top 3 products or countries based on count (product and countries separate columns)?

    • @SolutionsAbroad
      @SolutionsAbroad  2 ปีที่แล้ว

      Hey there, I covered that topic in this video: th-cam.com/video/vpGAf6Nkt1Q/w-d-xo.html

  • @amirbitan
    @amirbitan 3 ปีที่แล้ว +1

    Great video.
    I have this problem: how to create a measure that counts how many specific values appear in one column when the values in another column is not unique
    column 1 column 2
    a 1
    b 2
    a 3
    a 1
    b 4
    a 5
    b 6
    the answer I expect to get is 3 not 4
    Thanks

    • @SolutionsAbroad
      @SolutionsAbroad  3 ปีที่แล้ว +1

      Hi Amir, it sounds like you need to use the "Keep Duplicates" functionality in Power Query. Then from there you can either just do a count/countdistinct or do a "Remove Duplicates". Hope that helps!

  • @jermainecameron6209
    @jermainecameron6209 3 ปีที่แล้ว +2

    How can we count distinct values with expression filters like you did with the countx

    • @SolutionsAbroad
      @SolutionsAbroad  3 ปีที่แล้ว +1

      Hi Jermaine, for that you will have to use a combination of DISTINCT COUNT and FILTER, here's an article that covers that community.powerbi.com/t5/Desktop/Distinct-countx/td-p/154867

    • @jermainecameron6209
      @jermainecameron6209 3 ปีที่แล้ว +1

      @@SolutionsAbroad thank you so much, it worked perfectly

  • @vipulgoel4156
    @vipulgoel4156 3 ปีที่แล้ว +1

    How to count the number of times a text value appears in a column?

    • @SolutionsAbroad
      @SolutionsAbroad  3 ปีที่แล้ว

      You might need to do a countif alternative in DAX to do this: www.goodly.co.in/countif-power-bi-dax/

  • @jackjohnshei8374
    @jackjohnshei8374 2 ปีที่แล้ว +1

    hi i am using distinct count in excel ,how to exclude blank cells from pivot table.because blank cells value here showing as 1.

    • @SolutionsAbroad
      @SolutionsAbroad  2 ปีที่แล้ว

      Hi Shane, I gotta be honest I'm not too familiar with Power Pivot. Can you not add an implicit filter to exclude blanks or N/A?

  • @user-ht9ct4ih8p
    @user-ht9ct4ih8p 6 หลายเดือนก่อน

    How to display the row count to each record

  • @openuni7809
    @openuni7809 2 ปีที่แล้ว

    also DITINCTCOUNTNOBLANK - To avoid the blank one (:

  • @nehatalwar7567
    @nehatalwar7567 3 ปีที่แล้ว +1

    I am confused,I see count is taking blank value for me. Is that count takes blank value as well.

    • @SolutionsAbroad
      @SolutionsAbroad  3 ปีที่แล้ว

      Hi great question! Blank values are skipped docs.microsoft.com/en-us/dax/count-function-dax

  • @sathyanague3329
    @sathyanague3329 11 หลายเดือนก่อน

    Hi, I had one doubt in Power BI. I have made one measure (consider Measure 1) on distinct count for respective column which is fine. Similarly I need to pick another column based on this measure 1 which has both values and numerics. How could be done, Sir.
    UNIQ ID RANGES
    077GGG 1
    077GGG 1
    077GGG 1
    078GGG null
    078GGG null
    079GGG 5
    079GGG 5
    079GGG 5
    079GGG 5
    079GGG 5
    080GGG 1
    080GGG 1
    081GGG null
    081GGG null
    081GGG null
    In UNIQ ID column. I have used measure as distinct count and in card i will be getting 5 count
    On the RANGES column, when I use card, I need to get 3 count -----> stating like avoiding the nulls and getting
    1 for 077GGG
    5 for 079GGG
    1 for 080GGG
    Could u pls help on this, Sir?

  • @manuelboadi1343
    @manuelboadi1343 ปีที่แล้ว

    Please I want to write a measure that counts the most occurring number in a column

  • @leslieliew5712
    @leslieliew5712 2 ปีที่แล้ว

    I have 37 bathrooms…How can I calculate the percentage of bathrooms that are cleaned twice a day at each location?

  • @almyvblog7989
    @almyvblog7989 2 ปีที่แล้ว

    Please make a video connecting Power Bi to Mongodb

  • @rajm5349
    @rajm5349 2 ปีที่แล้ว

    can u xplain any project

  • @mivanows
    @mivanows ปีที่แล้ว

    Please help!
    I want to replicate the same result in Powerquery.
    Here is the example in Excel:
    56 77 46 3 ->formula =COUNT(A1:C1)
    33 54 2 ->formula =COUNT(A2:C2)
    Note that the A2 is [empty] - the count result is as expected (=2)
    I can't find a way to replicate it in Powerquery.
    Powerquery returns 3 - it is considering the empty as [NULL] and counting - the result is =3, but it should be =2.

  • @MS-xg4ep
    @MS-xg4ep ปีที่แล้ว

    Somehow the COUNT also counts the ZEROs in a row? Why is that the case?

  • @jaitiwari241
    @jaitiwari241 2 ปีที่แล้ว

    Please share dataset

  • @arunkumarramachandran5647
    @arunkumarramachandran5647 ปีที่แล้ว

    The letters are not clear , pls zoom the formula bar .

  • @khalidmajeed2886
    @khalidmajeed2886 ปีที่แล้ว

    why y cant make it in zoom it is tiny

  • @gintomino4136
    @gintomino4136 2 ปีที่แล้ว

    so countx and countax are like calculate with count, interesting

    • @SolutionsAbroad
      @SolutionsAbroad  2 ปีที่แล้ว

      Something like that, they are iterators and basically allows you to add extra filter context, similar to calculate!

  • @Phoenixspin
    @Phoenixspin 3 ปีที่แล้ว

    I learned to count in kindergarten.

  • @jlcanada6912
    @jlcanada6912 ปีที่แล้ว

    Dude! Speak way too fast!

  • @umagbaalex1624
    @umagbaalex1624 ปีที่แล้ว

    Thanks, Fernan for your videos. Very helpful to me. How do I connect to you on Linkedln