exam questions

Exam 70-778 All Questions

View all questions & answers for the 70-778 exam

Exam 70-778 topic 1 question 82 discussion

Actual exam question from Microsoft's 70-778
Question #: 82
Topic #: 1
[All 70-778 Questions]

DRAG DROP -
You have a property named FactInternetSales used by several Power BI reports. The query is shown in the exhibit. (Click the Exhibit button.)

You plan to create a bar chart showing the count of sales by year that have a SalesAmount greater than $1,000.
You need to create a measure that will be used in the bar chart.
How should you complete the DAX formula? To answer, drag the appropriate values to the correct targets. Each value may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Orl
Highly Voted 5 years, 11 months ago
Should be COUNTROWS.
upvoted 36 times
Hien
5 years, 10 months ago
I agree, the first function only have 1 parameter, then it is should be COUNTROWS, not COUNTX which requires 2 parameters.
upvoted 14 times
...
mirzotti
5 years, 7 months ago
COUNTROWS is not an aggretation funcion and will give an error. COUNX is an aggregator and that is correct.
upvoted 2 times
JohnFan
5 years, 6 months ago
FILTER(<table>,<filter>) Returns a table that represents a subset of another table or expression. Eg. SUMX(FILTER('InternetSales_USD', RELATED('SalesTerritory'[SalesTerritoryCountry])<>"United States"), 'InternetSales_USD'[SalesAmount_USD])
upvoted 2 times
...
...
...
twane
Highly Voted 5 years, 9 months ago
The FILTER command returns a table with only the rows where SALESAMOUNT > 1000. As the resultset is already filtered, you don't need COUNTX because there is no need to supply an additional column or expression, as pointed out by several others here. Moreover, the second argument for COUNTX is mandatory.
upvoted 17 times
JohnFan
5 years, 6 months ago
i couldn't agree with you more
upvoted 4 times
...
Vermonster
5 years, 5 months ago
Best explanation - completely agree
upvoted 4 times
...
Sam25
5 years, 1 month ago
So the first part should be COUNTROWS and not COUNTX
upvoted 2 times
wifaq
5 years ago
COUNTROWS(FILTER('Europe','Europe'[City]= "UK - London")) COUNTX(Europe,FILTER(Europe,Europe[City] = "UK - London")) So the answer is CountRows
upvoted 7 times
...
...
...
aa_1984
Most Recent 3 months, 3 weeks ago
Why can't we use CALCULATE instead of FILTER?
upvoted 1 times
...
nemanjaandic
4 years, 4 months ago
Countrows(filter(table,value>1000)) -- this is proper dax logic. First you filter only rows that match criteria and you get table result (multiple columns and multiple rows). After that you can use that table as parameter to function Countrows. Countrows(table) - this is syntax for countrows function.
upvoted 1 times
...
Lhouss
4 years, 6 months ago
COUNTROWS/FILTER
upvoted 1 times
...
thaodo
4 years, 7 months ago
Tested. COUNTROWS and FILTER is correct. https://docs.microsoft.com/en-us/dax/countrows-function-dax Remarks This function can be used to count the number of rows in a base table, but more often is used to count the number of rows that result from filtering a table, or applying context to a table. If using COUNTX, few argument error!
upvoted 1 times
...
CDL
4 years, 7 months ago
1, CountRows 2, Filter Not CountX is becoz it requires 2 arguments.
upvoted 2 times
...
itsmahouch
4 years, 8 months ago
why not COUNTA ?
upvoted 1 times
kyliek7
4 years, 7 months ago
COUNTA refers to column and not table, so not possible to add.
upvoted 1 times
kyliek7
4 years, 7 months ago
COUNTA would work only in like this: CALCULATE ( COUNTA (FactInternetsales[SalesAmount],FactInternetsales[SalesAmount]>1000))
upvoted 1 times
...
...
...
FakherThabti
4 years, 9 months ago
wrong answer the correct answer is used CountROW instead of Countx because contx takes 2 paramètres ( table, expression)
upvoted 2 times
...
Sebedu
4 years, 11 months ago
1st is countrows, 2nd filter i tried to use countx you get this error message "too few arguments...."
upvoted 3 times
...
Onkar26
5 years ago
I tried and below one is working and others are giving error COUNTROWS(FILTER(FactInternetsales,FactInternetsales[SalesAmount]>1000))
upvoted 1 times
...
Mange
5 years ago
There are two possible solutions here, they give the same result: 1: LargeSales = COUNTROWS(FILTER(FactInternetsales,FactInternetsales[SalesAmount]>1000)) 2LargeSales = CALCULATE(COUNTROWS(FactInternetsales,FactInternetsales[SalesAmount]>1000)) In fact, the solution with Calculate will be translated the to Filter version internally
upvoted 2 times
Mange
5 years ago
I must correct myself, the following is correct for CALCULATE and COUNTROWS: CALCULATE(COUNTROWS(FactInternetsales),FactInternetsales[SalesAmount]>1000) (see the change of parenthesis). In this case I agree with Onkar 26 below as we have two parenthesis at the end in the formula. It should be COUNTROWS and FILTER
upvoted 3 times
...
...
rainbowstuf
5 years ago
COUNTROWS(FILTER(TABLE, EXPRESSION) --
upvoted 1 times
...
Shanrb
5 years, 1 month ago
Tried and it should be COUNTROWS not COUNTX as it throws an error of having few arguments.
upvoted 4 times
...
claudia_learner
5 years, 1 month ago
The reason that it can't be COUNTX is not that it requires 2 Parameters (SalesAmount>1000 is a parameter!). BUT: COUNTX can not evaluate boolean expressions. The expression is just evaluated to be empty or not.
upvoted 1 times
...
Jony
5 years, 3 months ago
This will work - LargeSales = COUNTROWS(FILTER(FactInternetsales,FactInternetsales[SalesAmount]>1000))
upvoted 3 times
...
Old_Fun
5 years, 3 months ago
I think it should be calculate + countx
upvoted 2 times
Stanjaak
5 years, 3 months ago
I agree. Calculate with just one parameter is a bit of a waste in a measure, but countx on its own does the job! But countrows followed by filter is an alternative solution.
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...