cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JLK84
Frequent Visitor

MAX Value per Group with SELECTEDVALUE Filter

Hello,

And again I am stuck with this problem and I have no more ideas so any help will be greatly appreciated.


Goal:
I need measure that will take first/max or only sum first value for cumulative total from each group for sellected filter:
Cluster= Main
Year = 2021
Month = 3

My current measure is as below, and at the moment it's not returning expeced result:

 

Measure = 
CALCULATE (
    MAX( table[cumulative total] ),
    FILTER (
        ALL ( table),
        table[Date] <= MAX ( table[Date]) 
        && table[Year] = SELECTEDVALUE(table[Year])
        && table[Month] = SELECTEDVALUE(table[Month])
        && table[Cluster] = SELECTEDVALUE(table[Cluster])

))

 

 

ClusterPlant Lower LevelDateDayYearMonthCumulative total
MainPlant 1Thursday, July 1, 20211202130
MainPlant 1Friday, July 2, 20212202132
MainPlant 2Friday, July 2, 20212202132
MainPlant 1Saturday, July 3, 20213202133
MainPlant 2Saturday, July 3, 20213202133
MainPlant 1Sunday, July 4, 20214202135
MainPlant 2Sunday, July 4, 20214202135
MainPlant 1Monday, July 5, 20215202136
MainPlant 2Monday, July 5, 20215202136

 

 Then I want to put this in visual to looks like this (green line)

JLK84_0-1626355481602.png

 

Thanks,
Jacek

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @JLK84 ,

 

Your measure returns the following result, it shows the maximum of the Cumulative total column from the beginning of the month to date. What is the actual output you want?

 

image.png

 

Best Regards,
Winniz

 

View solution in original post

3 REPLIES 3
v-kkf-msft
Community Support
Community Support

Hi @JLK84 ,

 

Has your problem been solved? 

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

 

Best Regards,
Winniz

JLK84
Frequent Visitor

Hi @v-kkf-msft 

Thank you for your answer and support on this. You right measure returns correct results as expected, there was a issue with the client data. After your reply I was sure that the calculation is working correctly, which led me to the source of the problem hidden in the data. One more time, thank you,

v-kkf-msft
Community Support
Community Support

Hi @JLK84 ,

 

Your measure returns the following result, it shows the maximum of the Cumulative total column from the beginning of the month to date. What is the actual output you want?

 

image.png

 

Best Regards,
Winniz

 

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!