0
0
Power BIbi_tool~10 mins

COUNT and DISTINCTCOUNT in Power BI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to count all rows in the Sales table.

Power BI
TotalRows = [1](Sales)
Drag options to blanks, or click blank then click option'
AAVERAGE
BDISTINCTCOUNT
CSUM
DCOUNTROWS
Attempts:
3 left
💡 Hint
Common Mistakes
Using DISTINCTCOUNT instead of COUNTROWS.
Using SUM or AVERAGE which are for numbers, not counting rows.
2fill in blank
medium

Complete the code to count unique Customer IDs in the Sales table.

Power BI
UniqueCustomers = [1](Sales[CustomerID])
Drag options to blanks, or click blank then click option'
ACOUNT
BCOUNTROWS
CDISTINCTCOUNT
DSUM
Attempts:
3 left
💡 Hint
Common Mistakes
Using COUNTROWS which counts all rows, not unique values.
Using COUNT which counts non-blank values but not unique.
3fill in blank
hard

Fix the error in the code to count unique Product IDs.

Power BI
UniqueProducts = COUNTROWS([1](Sales[ProductID]))
Drag options to blanks, or click blank then click option'
ADISTINCTCOUNT
BDISTINCT
CVALUES
DALL
Attempts:
3 left
💡 Hint
Common Mistakes
Using DISTINCTCOUNT inside COUNTROWS which causes an error.
Using VALUES which can include duplicates if filters apply.
4fill in blank
hard

Fill both blanks to count all non-blank Sales amounts.

Power BI
NonBlankSales = [1](Sales[Amount]) - [2](Sales[Amount])
Drag options to blanks, or click blank then click option'
ACOUNT
BCOUNTBLANK
CDISTINCTCOUNT
DCOUNTROWS
Attempts:
3 left
💡 Hint
Common Mistakes
Using DISTINCTCOUNT which counts unique values, not blanks.
Using COUNTROWS which counts rows, not values.
5fill in blank
hard

Fill all three blanks to count unique Product IDs sold in 2023.

Power BI
UniqueProducts2023 = COUNTROWS(FILTER([1](Sales[ProductID]), Sales[Year] [2] [3]))
Drag options to blanks, or click blank then click option'
ADISTINCT
B=
C2023
DALL
Attempts:
3 left
💡 Hint
Common Mistakes
Using DISTINCTCOUNT inside FILTER which expects a table.
Using wrong comparison operators or values.