Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
Below is my sample data,
Expected output: ( date filter 01-02-2020 to 31-03-2020)
Assume that, I have data upto 30-04-2020.
I need to calculate the last 3 columns (as measures) and want to show the sum of sales amount where 'End total'=1.
Problem is that, I don't have date value, where 'End total'=1. This row is just to show the sum.
1) sum amount (selected range) - sum of sales amount between selected date range in the date filter.
2) sum amount (before selected range) - sum of sales amount, date ranges from begining (in this ex 01-01-2020) to the max selected date (To date in date filter).
3) sum amount (upto last date) - sum of sales amount which is not affected by date filter, that includes all date (ie from begining to ending of data).
Thanks in advance.......
Solved! Go to Solution.
Hi @Anonymous
Try these measures
Total Sales = SUM(Sales[Sales Amount])
Sales in Date Range =
IF(
ISFILTERED(Sales[Date]),
BLANK(),
CALCULATE(
[Total Sales],
VALUES('Calendar'[Date])
)
)
Sales Before Date Range =
VAR MaximumDate =
MAXX(
VALUES('Calendar'[Date]),
'Calendar'[Date]
)
RETURN
IF(
ISFILTERED(Sales[Date]),
BLANK(),
CALCULATE(
[Total Sales],
'Calendar'[Date] <= MaximumDate
)
)
All Sales =
IF(
ISFILTERED(Sales[Date]),
BLANK(),
CALCULATE(
[Total Sales],
ALL('Calendar'[Date])
)
)
Here's the results
Hope this helps! 🙂
Hi @Anonymous
Try these measures
Total Sales = SUM(Sales[Sales Amount])
Sales in Date Range =
IF(
ISFILTERED(Sales[Date]),
BLANK(),
CALCULATE(
[Total Sales],
VALUES('Calendar'[Date])
)
)
Sales Before Date Range =
VAR MaximumDate =
MAXX(
VALUES('Calendar'[Date]),
'Calendar'[Date]
)
RETURN
IF(
ISFILTERED(Sales[Date]),
BLANK(),
CALCULATE(
[Total Sales],
'Calendar'[Date] <= MaximumDate
)
)
All Sales =
IF(
ISFILTERED(Sales[Date]),
BLANK(),
CALCULATE(
[Total Sales],
ALL('Calendar'[Date])
)
)
Here's the results
Hope this helps! 🙂
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
12 | |
10 | |
10 | |
6 |