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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Fahad12
Frequent Visitor

How to Make Column = Unfiltered Data

So my issue is as follows:  I have a set of data as follows: 

 

Department Nameproductivity %

A

10%
B30%
C5%
D15%
E60%

 

 

 

 

I wanted to construct a DAX function to say IF this department name then return this productivity% then I will use it in a plot as an added filter. However, I would also like to include in the IF statement that IF(Department Name = all unfiltered Department Name then 20%) so when I remove the Department Name filters from the chart I get the value 20% for productivity%.... 

 

so I am struggling with this issue I've tried using ALL, ALLSELECTED, IN but without result. 

 

Your help is appreciated.

3 REPLIES 3
Fahad12
Frequent Visitor

the issue lays in this expression... I am trying to say IF(Department Name = {A and B and C and D and E} then 20%... but I don't know the syntax to do so .. I tried IF(Department Name IN {A,B,C,D,E} then 20% but it gives me wrong result. is there any way to make the column equal all the combined departments so when filter is removed it retains the 20% value?

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1676869672456.png

 

Expected result measure: =
VAR _slicerselectcount =
    COUNTROWS ( ALLSELECTED ( Data[Department Name] ) )
VAR _alldeptcount =
    COUNTROWS ( ALL ( Data[Department Name] ) )
RETURN
    IF ( _slicerselectcount = _alldeptcount, 0.2, SUM ( Data[productivity %] ) )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Yeah there is one note here...  the graph I am trying to plot is from another dataset that is not in this table.... this table is only an applied filter on top of that dataset graph.... the filter is the department name so when you choose it it displays the productivity% on top of that graph... so I was struggling with how I can include it in the IF statement that if select all departments then productivity% = 20%  

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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