The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
So my issue is as follows: I have a set of data as follows:
Department Name | productivity % |
A | 10% |
B | 30% |
C | 5% |
D | 15% |
E | 60% |
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.
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?
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
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 %] ) )
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%
User | Count |
---|---|
74 | |
70 | |
39 | |
30 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
48 | |
46 |