Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I would like to create a measure that calculates the total Gross sales for each customer where identity = Sales Table and invoice date is before 1/1/2024.
Based on the table below the desired result would be Customer A has 3,000 in Gross Sales
Segment | Site Name | Customer | Identity | Gross Sales | InvoiceDate |
light | NY | A | Sales Table | 1000 | 1/1/2020 |
light | NC | A | Sales Table | 1000 | 1/1/2024 |
light | NC | A | Sales Table | 200 | 1/1/2023 |
plastic | NC | A | Sales Table | 300 | 2/1/2024 |
plastic | NC | A | Sales Table | 500 | 12/1/2023 |
paper | NC | A | Sales Table | 1000 | 11/1/2022 |
paper | NC | A | Sales Table | 2000 | 4/1/2024 |
coal | AL | A | Sales Table | 100 | 11/1/2022 |
coal | AL | A | Sales Table | 100 | 6/1/2024 |
coal | AL | A | Sales Table | 200 | 5/1/2023 |
coal | AL | A | Budget Table | 100 | 6/1/2024 |
coal | AL | A | Budget Table | 200 | 5/1/2023 |
Solved! Go to Solution.
Give this a try.
Pre 2024 gross sales =
CALCULATE (
SUM ( YourTable[Gross Sales] ),
YourTable[Identity] = "Sales Table",
YourTable[InvoiceDate] < DATE ( 2024, 1, 1 )
)
Give this a try.
Pre 2024 gross sales =
CALCULATE (
SUM ( YourTable[Gross Sales] ),
YourTable[Identity] = "Sales Table",
YourTable[InvoiceDate] < DATE ( 2024, 1, 1 )
)
@jdbuchanan71 thank you, this works perfectly. I have a page level slicer that slices on the year 2024. Can you help me edit your measure so that it is not impacted by this page level slicer?
Yep, we can force it to ignore anything outside the measure like this.
Pre 2024 gross sales =
CALCULATE (
SUM ( YourTable[Gross Sales] ),
REMOVEFILTERS ( YourTable ),
YourTable[Identity] = "Sales Table",
YourTable[InvoiceDate] < DATE ( 2024, 1, 1 )
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
128 | |
76 | |
55 | |
41 | |
40 |
User | Count |
---|---|
206 | |
83 | |
72 | |
56 | |
51 |