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.
Hello
i have a DAX formula like this
Kolicina max Dat =
CALCULATE (
SUM ( List1[dejstkg] ),
FILTER ( ALL ( List1), List1[Datum] = MAX (List1[Datum] )),
VALUES(List1[Naziv enote])
)
but I would like to have chosen max date (datum) in this sample is 14.03.2021.
sample:
example
https://drive.google.com/file/d/1QWQSrfPIeHr1W6NiYuVgkvIpMrNRE8As/view?usp=sharing
thx
Hi, @LeaRupnik
Please try to replace the measure with the below.
If you change your DATUM column to date-only-type, it will be easier to write the measure.
Kolicina max Dat V2 =
VAR maxdate =
DATE ( YEAR ( CALCULATE ( MAX ( List1[datum_posnetka] ), ALL ( List1 ) ) ), MONTH ( CALCULATE ( MAX ( List1[datum_posnetka] ), ALL ( List1 ) ) ), DAY ( CALCULATE ( MAX ( List1[datum_posnetka] ), ALL ( List1 ) ) ) )
VAR currentnazivenote =
MAX ( List1[Naziv enote] )
RETURN
CALCULATE (
SUM ( List1[dejstkg] ),
FILTER (
ALL ( List1 ),
DATE ( YEAR ( List1[Datum] ), MONTH ( List1[Datum] ), DAY ( List1[Datum] ) ) = maxdate
&& List1[Naziv enote] = currentnazivenote
)
)
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@LeaRupnik , Try like
Kolicina max Dat =
var _max = maxx(allselected(List1),List1[Datum])
return
CALCULATE (
SUM ( List1[dejstkg] ),
FILTER ( ALL ( List1), List1[Datum] = _max),
VALUES(List1[Naziv enote])
)
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 |
---|---|
42 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
39 | |
33 | |
18 | |
17 |