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
huguest
Advocate II
Advocate II

Slicer and DAX Column not working

Hello,

I have a "Date" table and a "Cases" table that are not linked. 

 

I created the following DAX Column in my "Date" table to return the number of Cases reported to date (based on count of IDs) and it is working fine.

 

Column= CALCULATE ( DISTINCTCOUNT( 'Cases'[ID]), FILTER('Cases','Cases'[Reported On] <= 'Date'[Date] ))
 
If I add a filter for the Department as follows, it still works as expected:
 
Column = CALCULATE ( DISTINCTCOUNT( 'Cases'[ID]), FILTER('Cases','Cases'[Reported On] <= 'Date'[Date] && 
'Cases'[Department] = "Business Technology" ))
 

I am trying to replace the Department condition with a slicer that will allow me to select any available Department, but it is not working.

 

I tried the following with a slicer visual that cotains the 'Cases'[Department] field:

 

Column= CALCULATE ( DISTINCTCOUNT( 'Cases'[ID]), FILTER('Cases','Cases'[Reported On] <= 'Date'[Date] && 

'Cases'[Department] = SELECTEDVALUE('Cases'[Department]) ))  

 

I also tried creating a new "Department" table with all the possible values and adding is as a slicer with the following:

 

Column= CALCULATE ( DISTINCTCOUNT( 'Cases'[ID]), FILTER('Cases','Cases'[Reported On] <= 'Date'[Date] && 

'Cases'[Department] = SELECTEDVALUE('Department'[Department]) ))  
 
Any help would be appreciated.
 
Hugues.
1 ACCEPTED SOLUTION
huguest
Advocate II
Advocate II

4 REPLIES 4
huguest
Advocate II
Advocate II

I think that I found the reason why along with a solution in this post: https://community.powerbi.com/t5/Desktop/SELECTEDVALUE-date-not-working-as-filter-in-SUMMARIZE-Table....  Thank you @Zubair_Muhammad .

Hi , @huguest 

Looks like my reply was a little late. But it's great to hear your problem got resolved!

It's true that it's better to use measure rather then calculate columns here.

I also make a demo here: pbix attached

 

Could you please tell me whether your problem has been solved?
If it is ,please kindly  accept your reply as solution to close this thread, that way, other community members will easily find the solution when they get the same issue.

 

Best Regards,
Community Support Team _ Eason

amitchandak
Super User
Super User

Check if the interaction has been disabled

 

Interactions.png

Good suggestion, but it is active 😞

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.