Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
Considering the example:
I would like to compute the sum of timeminutes column for the max value of version column within each idproject column (yellow cells) for each iddate. The result should be the one shown on the right table. What's the best way to do this with dax?
Thank you!
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
timeminutes expected result: =
VAR _maxversiontable =
GROUPBY (
Data,
Data[idproject],
"@maxversion", MAXX ( CURRENTGROUP (), Data[version] )
)
RETURN
IF (
HASONEVALUE ( Data[iddate] ),
CALCULATE (
SUM ( Data[timeminutes] ),
TREATAS ( _maxversiontable, Data[idproject], Data[version] )
)
)
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.
Schedule a short Teams meeting to discuss your question
Thank you @Jihwan_Kim !
Would this also work if the max depends on more than one column? For example if I need to consider for the max columns idproject, idcampaign, idemployee, etc?
Hi,
Thank you for your message. It works if the additional columns are included inside the measure.
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.
Schedule a short Teams meeting to discuss your question
Hi,
Please check the below picture and the attached pbix file.
timeminutes expected result: =
VAR _maxversiontable =
GROUPBY (
Data,
Data[idproject],
"@maxversion", MAXX ( CURRENTGROUP (), Data[version] )
)
RETURN
IF (
HASONEVALUE ( Data[iddate] ),
CALCULATE (
SUM ( Data[timeminutes] ),
TREATAS ( _maxversiontable, Data[idproject], Data[version] )
)
)
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.
Schedule a short Teams meeting to discuss your question
User | Count |
---|---|
16 | |
14 | |
13 | |
12 | |
11 |
User | Count |
---|---|
19 | |
16 | |
15 | |
11 | |
9 |