Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
551 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Software ==> | DAX (59 exercises) |
Topic ==> | The FILTER function (4 exercises) |
Level ==> | Relatively easy |
Subject ==> | Power BI training |
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
Open the Power BI file in the above folder:
At the moment the matrix shows a dummy measure.
The SUMX function uses this syntax:
The table can be a table, or the set of rows returned from a FILTER function. We'll create examples of both types of syntax!
Use this information to create a measure called Sales, which should sum the price multiplied by the quantity. Show this measure in your matrix to give:
You should see a report showing total sales by purchase year and environment.
Copy the formula for this measure, and use this as a basis to create a new measure called Sales in 2018. This measure should use the FILTER function to only sum sales where the year for the purchase date is 2018.
You can use the YEAR function to return the year corresponding to any date.
Show this measure in the matrix to get the following;
The matrix collapses, as there are only figures for 2018.
Now copy the formula for this measure again and amend it to create another measure called Big sales 2018, which only sums sales where:
This should give the following table:
The figures are falling, as we filter out more purchases.
You can use the AND function, the && operator or nested FILTER functions to achieve this - the choice (as Graham used to say) is yours!
Save this file as Special measures, then close it down.
You can find other training resources for the subject of this exercise here:
From: | ksaibhargav |
When: | 09 Apr 20 at 10:21 |
big sales = CALCULATE([total sales],FILTER('Purchase',AND(YEAR('Purchase'[PurchaseDate])=2018,Purchase[Quantity]>5)=TRUE()))
where
total sales = sumx('Purchase','Purchase'[Quantity]*Purchase[Price])
Why is this not working?
From: | Andy B |
When: | 10 Apr 20 at 12:09 |
The quantity should be greater than or equal to 5, not greater than 5. Failing that, compare your formula with the answer given?
From: | DixonAlfred |
When: | 31 Oct 24 at 08:44 |
Yep it does have a problem when we write only >5 but when we write >=5 it works
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.