Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I want to sum the Amount after using two distinct Period Values coming from two distinct filter.
Filter1 = Period1 => Select the first date of the period which is 01/01/2023
Filter2 = Period3 => Select the LastDate of the period which is 31/03/2023
The sum should be : 100 + 150 + 200 + 200 + 500 + 600
My Data :
Period | Date | Amount |
1 | 01-01-2023 | 100 |
1 | 21-01-2023 | 150 |
2 | 01-02-2023 | 200 |
2 | 10-02-2023 | 200 |
3 | 17-03-2023 | 500 |
3 | 24-03-2023 | 600 |
... | ||
12 | 01-12-2023 | 1200 |
12 | 31-12-2023 | 5000 |
Using a slicer for dates works fine and it's not a big deal. But I don't know how to do the same by seperating the filters.
Thank you
Solved! Go to Solution.
Hi @Safus09
Please try this:
I select two date in the filter:
Then add a measure:
MEASURE =
VAR _maxDate =
CALCULATE ( MAX ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) )
VAR _minDate =
CALCULATE ( MIN ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) )
RETURN
CALCULATE (
SUM ( 'Table'[Amount] ),
FILTER (
ALL ( 'Table' ),
'Table'[Date] >= _minDate
&& 'Table'[Date] <= _maxDate
)
)
The result(150 +200 +200 +500) is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
What is you create just one slicer for the period (set to the between format). Select 1 to 3 in the slicer. Then just write this measure and drag it to a card visual
Measure = sum(Data[Amount])
Hope this helps.
Hi @Safus09
Please try this:
I select two date in the filter:
Then add a measure:
MEASURE =
VAR _maxDate =
CALCULATE ( MAX ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) )
VAR _minDate =
CALCULATE ( MIN ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) )
RETURN
CALCULATE (
SUM ( 'Table'[Amount] ),
FILTER (
ALL ( 'Table' ),
'Table'[Date] >= _minDate
&& 'Table'[Date] <= _maxDate
)
)
The result(150 +200 +200 +500) is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Are you looking for just another slicer for the period like this. If that is what you want then you need to format the Period column to a numeric value. Also make sure that you do not have anything but numbers in this column no "...". Then just add a slicer similar to date slicer and add Period.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
105 | |
77 | |
67 | |
63 |
User | Count |
---|---|
144 | |
107 | |
105 | |
82 | |
69 |