You have a property named FactInternetSales used by several Power BI reports. The query is shown in the exhibit.
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.
You have a Power BI model for sales data. You create a measure to calculate the year-to-date sales.
You need to compare the year-to-date sales with the previous year for the same time period.
To be able to compare you need to create a 2nd measure to calculate ytd sales same period previous year:
YtdSalesSamePeriodLastYear = CALCULATE([YtdSales], SAMEPERIODLASTYEAR(FactInternetSales[DueDate]))
Question 134
You have a Power BI model that contains tables named Sales and Date. Sales contains four columns named SalesAmount, OrderDate, SalesPerson, and
OrderID.
You need to create a measure to calculate the last 12 months of sales. You must start from the last date a sale was made and ignore any filters set on the report.
How should you complete the DAX formula?
Answer is DATEADD and LASTNONBLANK
1. get the date 12 months ago: DateAdd
2. get the valid last date: LastNonBlank
3. nested above 2 together by “Calculate”
You have a Power BI model that contains a table named Person. Person contains a whole number column named Age.
You need to write a DAX measure that finds the middle value in the range of Age values.
Which two formulas should you use? Each answer presents a complete solution.
MEDIAN(‘Person’[Age])
PERCENTILE.INC((‘Person’[Age], 0.5)
AVERAGE(‘Person’[Age])
RANK.EQ(‘Person’[Age], ‘Person’[Age])
Question 136
You have a Power BI model that contains the following two tables:
- Assets (AssetID, AssetName, Purchase_DateID, Value)
- Date (DateID, Date, Month, Week, Year)
The tables have a relationship. Date is marked as a date table in the Power BI model.
You need to create a measure to calculate the percentage that the total assets value increased since one year ago.