Forum Discussion
Retrieve values from rows where monthly max occurs.
- 5 years ago
heberpower can you throw sample data in a pbix file and expected output, will get back to you with the solution.
- Anonymous5 years ago
Hi heberpower
I think you want to show the max Hour per month.
You can try to build a matrix visual and use a measure filter in this visual.
My Sample:
Measure:
Measure = VAR _MaxHourPerMonth = MAXX(FILTER(ALL('Table'),'Table'[Year]=MAX('Table'[Year])&&'Table'[Month]=MAX('Table'[Month])),'Table'[Hour]) VAR _MaxDate = CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),'Table'[Year]=MAX('Table'[Year])&&'Table'[Month]=MAX('Table'[Month])&&'Table'[Hour]=_MaxHourPerMonth)) RETURN IF(MAX('Table'[Date])=_MaxDate,1,0)Result is as below.
Set the measure to show items when the value is 1.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous5 years ago
Hi heberpower
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Rico Zhou
Hi heberpower
I think you want to show the max Hour per month.
You can try to build a matrix visual and use a measure filter in this visual.
My Sample:
Measure:
Measure =
VAR _MaxHourPerMonth = MAXX(FILTER(ALL('Table'),'Table'[Year]=MAX('Table'[Year])&&'Table'[Month]=MAX('Table'[Month])),'Table'[Hour])
VAR _MaxDate = CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),'Table'[Year]=MAX('Table'[Year])&&'Table'[Month]=MAX('Table'[Month])&&'Table'[Hour]=_MaxHourPerMonth))
RETURN
IF(MAX('Table'[Date])=_MaxDate,1,0)
Result is as below.
Set the measure to show items when the value is 1.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- heberpower5 years agoFrequent Visitor
Thanks for the idea! I think you are on the right track but when I use that measure I end with with the results from the last day of every month. Do you have any idea what I have done wrong?
- heberpower5 years agoFrequent Visitor
I see what is happening here, you are getting the max hour per month, actually I need the row with the max Peak Generation in each month. I do not know how to do this. I really do appreciate your help!
- Ashish_Mathur5 years ago
Super User
Hi,
On a small dataset, please show the expected result.