0
0
Power BIbi_tool~20 mins

COUNTROWS in Power BI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
COUNTROWS Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
COUNTROWS with FILTER and ALL

Given a table Sales with columns Product and Quantity, what is the result of this DAX measure?

CountAllProducts = COUNTROWS(ALL(Sales[Product]))
Power BI
CountAllProducts = COUNTROWS(ALL(Sales[Product]))
AThe total number of rows in the Sales table
BThe total number of unique products in the Sales table
CThe total number of products filtered by current context
DThe total quantity summed across all products
Attempts:
2 left
💡 Hint

Think about what ALL does to the filter context on the Product column.

visualization
intermediate
1:30remaining
Best Visualization for COUNTROWS Result

You have a measure that counts the number of customers who made purchases this month. Which visualization best shows this single number clearly on a dashboard?

AA pie chart showing percentage of customers by region
BA clustered bar chart with customer names on the axis
CA card visual showing the count number
DA line chart showing customer count over time
Attempts:
2 left
💡 Hint

Think about the simplest way to show a single number clearly.

data_modeling
advanced
2:30remaining
COUNTROWS with RELATEDTABLE in a Star Schema

In a star schema, you have a Customers table and a related Sales table. You want to create a measure in Customers that counts how many sales each customer made. Which DAX measure is correct?

ASalesCount = COUNTROWS(RELATEDTABLE(Sales))
BSalesCount = COUNTROWS(Sales)
CSalesCount = COUNTROWS(RELATED(Sales))
DSalesCount = COUNTROWS(FILTER(Sales, Sales[CustomerID] = Customers[CustomerID]))
Attempts:
2 left
💡 Hint

RELATEDTABLE returns the rows in the related table for the current row in the Customers table.

🔧 Formula Fix
advanced
2:00remaining
Why does this COUNTROWS measure return an unexpected zero?

Given this measure:

ActiveCustomers = COUNTROWS(FILTER(Customers, Customers[IsActive] = TRUE()))

It always returns zero even though some customers are active. What is the most likely cause?

AThe IsActive column is text 'TRUE' not boolean TRUE
BFILTER is missing a closing parenthesis
CThe Customers table is empty
DCOUNTROWS cannot be used with FILTER
Attempts:
2 left
💡 Hint

Check the data type of the IsActive column and the filter condition.

🧠 Conceptual
expert
3:00remaining
COUNTROWS Behavior with Virtual Tables and Context

Consider this measure:

CountFiltered = COUNTROWS(FILTER(ALL(Sales), Sales[Quantity] > 10))

What does this measure return when used in a report filtered by a specific Product category?

AThe count of all sales rows regardless of Quantity or product
BThe count of sales rows with Quantity > 10 only for the filtered product category
CThe total number of products with sales quantity > 10
DThe count of all sales rows with Quantity > 10 ignoring the product filter
Attempts:
2 left
💡 Hint

Think about what ALL does to the filter context inside FILTER.