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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
MyPowerbi2020
Helper IV
Helper IV

Need Help With DAX

 

Dear Team,

I need to return a table based on the slicer selection. I did the following,

here Date is the slicer & my table name is Data. Not sure why this is not working , kindly help.

 

Table =
var __SelectedValue = SELECTEDVALUE(Data[Date])
return
Filter(
'Data',
'Data'[Date] = __SelectedValue
)
 
Thanks.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @MyPowerbi2020 ,

You can follow the steps in the below screen shot:

1. Create a Date table and slicer with date field in Date table

2. Create a measure as below to get the count of clicker and non clicker

Count =
VAR _startdate =
    MIN ( 'Date'[Date] )
VAR _enddate =
    MAX ( 'Date'[Date] )
VAR _tab =
    SUMMARIZE (
        FILTER (
            ALLSELECTED ( 'EmailInfo' ),
            'EmailInfo'[Date] >= MIN ( 'Date'[Date] )
                && 'EmailInfo'[Date] <= MAX ( 'Date'[Date] )
        ),
        EmailInfo[Email],
        "nClicked", MAX ( 'EmailInfo'[Clicked] )
    )
RETURN
    COUNTX ( FILTER ( _tab, [nClicked] = MAX ( 'EmailInfo'[Clicked] ) ), [Email] )

Need help with DAX.JPG

Best Regards

Rena

View solution in original post

5 REPLIES 5
mahoneypat
Microsoft Employee
Microsoft Employee

If you are trying to return a calculated table, you can't have that respond to a slicer.  And you can't return a table in a measure (just some aggregation of one).  If you describe more about what you are trying to achieve, an alternate solution can be proposed.

 

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Kindly find below the requirement:

The input data is as follows: (Please note the input data tab)

https://drive.google.com/file/d/1iZGAcXAye5xlyshEgpg9IGiiHqEXQF0h/view?usp=sharing

Requirement:

basically based on the date selection if the max value for the Clicked column is 1 aganst the email then the user should be treated as CLicker.

Output example (as stated in the output data tab):

Here for this output data the logic is - the user has selected 2 dates: August 20 and August 21, since for the ABC email the maximum value of the column that was clicked (in the data input) is 1 in the given data range, the ABC email should be treated as Clicker.

Final Output in the report should be,

Status COUNT

Clicker 2

Non Clicker 1



Thank you.

Anonymous
Not applicable

Hi @MyPowerbi2020 ,

You can follow the steps in the below screen shot:

1. Create a Date table and slicer with date field in Date table

2. Create a measure as below to get the count of clicker and non clicker

Count =
VAR _startdate =
    MIN ( 'Date'[Date] )
VAR _enddate =
    MAX ( 'Date'[Date] )
VAR _tab =
    SUMMARIZE (
        FILTER (
            ALLSELECTED ( 'EmailInfo' ),
            'EmailInfo'[Date] >= MIN ( 'Date'[Date] )
                && 'EmailInfo'[Date] <= MAX ( 'Date'[Date] )
        ),
        EmailInfo[Email],
        "nClicked", MAX ( 'EmailInfo'[Clicked] )
    )
RETURN
    COUNTX ( FILTER ( _tab, [nClicked] = MAX ( 'EmailInfo'[Clicked] ) ), [Email] )

Need help with DAX.JPG

Best Regards

Rena

amitchandak
Super User
Super User

@MyPowerbi2020 , Try a new table like

 

calculatetable(Table,Filter('Data','Data'[Date] = __SelectedValue))

or

calculatetable(Table,Filter('Data','Data'[Date] in allselected(Data[Date) ))

or

calculatetable(Table,Filter('Data','Data'[Date] in values(Data[Date) ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak ,

Thanks,

Could you please let me know the entire formula. This seems to be not working.

 

Thanks.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors