Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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 )
)
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
110 | |
106 | |
85 | |
35 | |
35 |
User | Count |
---|---|
156 | |
110 | |
80 | |
61 | |
54 |