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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
MyPowerbi2020
Helper IV
Helper IV

Need help with Dax

MyPowerbi2020_0-1598164311524.png

 

Dear Experts,

 

I have the data like the above , user has a date slicer . The requirement is if user selects a date or dates that should give the below table :

Email , MAX value of clicked.

 

Thanks.

15 REPLIES 15
pranit828
Community Champion
Community Champion

HI @MyPowerbi2020 

I would use the below

Measure = CALCULATE(MAX(Table[Clicked]),ALLEXCEPT('Table','Table'[EMAIL]),'Table'[Date]))
The above will give the max number of clicks for every row based on email and date.




PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

Hi Pranit, Thanks for the reply , but the measure is always returning 1 , irrespective of dates.

 

Thanks.

HI @MyPowerbi2020

Can also screenshot your output.





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

MyPowerbi2020_0-1598166014876.png

 

Thanks.

Hi @MyPowerbi2020 

Please also paste the expected output if the below measure doesn't work. The sample input is in the ask.

CALCULATE(MAX(Table[Clicked]),ALLEXCEPT('Table','Table'[EMAIL]),'Table'[CompainName]))





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

Hi @pranit828 ,

I think this is not working.

 

MyPowerbi2020_0-1598166572678.png

 

Thanks.

 

HI @MyPowerbi2020 

Its because the the CampaignName was misspelled in the privous reply.

use below

CALCULATE(MAX(Table[Clicked]),ALLEXCEPT('Table','Table'[EMAIL]),'Table'[CampaignName]))




PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

Hi @pranit828 

In my end I have typed that correctly , not sure its not working.

 

Thanks.

HI @MyPowerbi2020 

Can you paste what you are expeting as the output for the input you have pasted in the original ask.





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

Hi @pranit828 

basically based on the selected dates I need to show the MAX(Clicked) for any EMAIL.

 

Thanks.

Hi @MyPowerbi2020 

check this it will show only for email.

Measure = CALCULATE(MAX(Table[Clicked]),ALLEXCEPT('Table','Table'[EMAIL]))





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

@pranit828 ,

no this is not working.

 

MyPowerbi2020_0-1598168594744.png

 

Thanks,

Hi , @MyPowerbi2020 

If you just  need show the max clicked,just try measure as below:

Max clicked = 
VAR t =
    ALLSELECTED ( Data )
VAR tab =
    SUMMARIZE (
        t,
        Data[Email],
        "Result", CALCULATE (
            MAX ( Data[Clicked] ),
            FILTER ( t, Data[Email] = EARLIER ( Data[Email] ) )
        )
    )
RETURN
   SUMX ( FILTER ( tab, [Email] = SELECTEDVALUE ( Data[Email] ) ), [Result] )

27.png

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi , @MyPowerbi2020 

Try measure as below:

result = 
VAR t =
    ALLSELECTED ( Data )
VAR tab =
    SUMMARIZE (
        t,
        Data[Email],
        "Result", CALCULATE (
            MAX ( Data[Clicked] ),
            FILTER ( t, Data[Email] = EARLIER ( Data[Email] ) )
        )
    )
RETURN
    IF (
        ISFILTERED ( Dates[Date] ),
        IF (
            SELECTEDVALUE ( Data[Clicked] )
                = SUMX ( FILTER ( tab, [Email] = SELECTEDVALUE ( Data[Email] ) ), [Result] ),
            1,
            0
        ),
        1
    )

Then apply it to visual filter pane.

208.png

 

 

Please refer to the attached file for more details.

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

How about simply this?

MaxClicked = MAX(Data[Clicked])

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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