Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. 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 )
)
User | Count |
---|---|
116 | |
80 | |
77 | |
61 | |
57 |
User | Count |
---|---|
128 | |
109 | |
96 | |
70 | |
68 |