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
NeimadB
Helper II
Helper II

Dynamic filtering on computed DAX table with slicer

Hello,

 

I'm currently facing a problem with a computed table : I want to know the restaurant without any survey for the given period in slicer, and display the list in a table on my report.

 

I've written a DAX function (thanks to a previous question here) to get this information, but I'm not able to do it dynamically.

 

Here is my data scheme : 

 

fact.Surveys

RestaurantId

DateId

CompletedSurveyDate

RestaurantName

 

dimension.Restaurants

RestaurantId

RestaurantName

 

dimension.Date

DateId

Date

 

Here is the first code, but unfortunately, it's not dynamic 

 

ComputedRestaurantWithoutCompletedSurveyQuestions = 
VAR CompletedSurveyQuestionsRestaurants =
DISTINCT (
SUMMARIZE(
FILTER ( 'CompletedSurveyQuestions', 'CompletedSurveyQuestions'[CompletedSurveyDate] >= MIN ( 'dimension Date'[DateDate] )
&& 'CompletedSurveyQuestions'[CompletedSurveyDate] <= MAX ( 'dimension Date'[DateDate] )
), 'CompletedSurveyQuestions'[RestaurantName] )
)
VAR ListRestaurants = VALUES ( 'dimension Restaurants'[RestaurantName] )
VAR NoCompletedSurveyQuestionsRestaurants = EXCEPT ( ListRestaurants , CompletedSurveyQuestionsRestaurants )
RETURN NoCompletedSurveyQuestionsRestaurants

 

 

So atfer that, I've created 2 measures in my dimension Date table in order to get Min / Max selected values in my slicer, change my DAX table code, but it also doesn't work

 

 

Date Selected Max = 

    CALCULATE(

        MAX( 'dimension Date'[DateDate] ),

        ALLSELECTED( 'dimension Date'[DateDate] )

    )
 
 
Date Selected Min = 

    CALCULATE(

        MIN( 'dimension Date'[DateDate] ),

        ALLSELECTED( 'dimension Date'[DateDate] )

    )

 

ComputedRestaurantWithoutCompletedSurveyQuestions = 
VAR CompletedSurveyQuestionsRestaurants =
DISTINCT (
SUMMARIZE(
FILTER ( 'CompletedSurveyQuestions', 'CompletedSurveyQuestions'[CompletedSurveyDate] >= ( 'dimension Date'[Date Selected Min] )
&& 'CompletedSurveyQuestions'[CompletedSurveyDate] <= ( 'dimension Date'[Date Selected Max] )
), 'CompletedSurveyQuestions'[RestaurantName] )
)
VAR ListRestaurants = VALUES ( 'dimension Restaurants'[RestaurantName] )
VAR NoCompletedSurveyQuestionsRestaurants = EXCEPT ( ListRestaurants , CompletedSurveyQuestionsRestaurants )
RETURN NoCompletedSurveyQuestionsRestaurants
 
How can I make this table dynamic, depending on the date slicer ?
 
Thank you
 
 
 
3 REPLIES 3
NeimadB
Helper II
Helper II

Hello,

 

Here is the output I want : A table with the name of restaurants without survey on the selected period in the Date Slicer.

I want this table to be dynamic (At the moment, it's not, change the date in the slicer does nothing. Maybe my DAX code is wrong).

 

Desired Output :

RestaurantNameList.png

 

Date Slicer :

 

slicerDate.PNG

Please take the time to provide sample data that covers your issue or question completely.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided. Your screenshot came over all garbled.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

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.