Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Display counter based on specific max date

Hello,

 

I am currently in trouble to be able to display a specific graph.

I have a table with Dates and multiple rows with counter:

DateCounter
01/01/20201
02/02/20201
02/02/20201
03/03/20201
03/03/20201
03/03/20201

 

I have calculated average count to display it through time :

Average = Averagex (Values([Date]);sum([Counter]))
AverageCountersPerDay.PNG
This is what it looks like when I display the average value and the day at the same time.
I am now trying to find the Day where this average is at its maximum value. I could only get the max average value so far using this : 
MAXX(
    KEEPFILTERS(VALUES([Day]));
    CALCULATE([Average])
)
 
I would like to get the date related to this value, to be able to filter a graph with this date.
My first question is : How can I get this date ?
Second question : Is it possible to filter a graph with a date coming from a measure ?
 
Thanks for your help ! 🙂
 
Antoine
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

Create the following measures:

 

Max of Averages= MAXX(ALLSELECTED('Table'[Date]);[Average])


Maximum Date of Maximum average = 
 (
    CALCULATE (
        MAX ( 'Table'[Date] );
        FILTER (
            SUMMARIZE ( ALLSELECTED ( 'Table' ); 'Table'[Date]; "@Average_Value"; [Average] );
            [@Average_Value] = [Max of Averages]
        )
    )
)


Filter = if(SELECTEDVALUE('Table'[Date]) = [Maximum Date of Maximum average];1 ; 0)

 

Now use the Filter  to filter out your visualization.

 

Check PBIX file attach, I have chan the data to get the maximum on 2/2 to check if my formulas where correct.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @Anonymous ,

 

Create the following measures:

 

Max of Averages= MAXX(ALLSELECTED('Table'[Date]);[Average])


Maximum Date of Maximum average = 
 (
    CALCULATE (
        MAX ( 'Table'[Date] );
        FILTER (
            SUMMARIZE ( ALLSELECTED ( 'Table' ); 'Table'[Date]; "@Average_Value"; [Average] );
            [@Average_Value] = [Max of Averages]
        )
    )
)


Filter = if(SELECTEDVALUE('Table'[Date]) = [Maximum Date of Maximum average];1 ; 0)

 

Now use the Filter  to filter out your visualization.

 

Check PBIX file attach, I have chan the data to get the maximum on 2/2 to check if my formulas where correct.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors