Forum Discussion

heberpower's avatar
heberpower
Frequent Visitor
5 years ago
Solved

Retrieve values from rows where monthly max occurs.

I have a situation where my boss wants to know the date, hour and values of our generation data for each month.  This is breaking my brain.  We have 5 years of hourly data. Here what I envision the r...
  • parry2k's avatar
    5 years ago

    heberpower can you throw sample data in a pbix file and expected output, will get back to you with the solution.

  • Anonymous's avatar
    Anonymous
    5 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. 

  • Anonymous's avatar
    Anonymous
    5 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