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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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