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.
Dear Team,
I am trying to calculate count rows, that should fetch all record count except the filter in two columns. However this seems to be not working on power BI desktop.
I am getting same value though I change in the values in the columns mentioned in the all except clause).
Arr_Movements_no_filter:=COUNTROWS(ALLEXCEPT('Arrivals',Arrivals[CANCEL_CODE])).
I selected cancel code value, however no change in the value.
Please help.
Thanks!
Shamsuddeen
Solved! Go to Solution.
Hi Shamsuddeen,
When you use ALLEXCEPT as in your example (i.e. not as a top-level filter argument for CALCULATE), it returns an unfiltered table containing all distinct rows of the table specified in the first argument, with the columns in the 2nd arguments onwards excluded from the table.
In your case, ALLEXCEPT('Arrivals',Arrivals[CANCEL_CODE]) returns an unfiltered 'Arrivals' table with the [CANCEL_CODE] column removed (reduced to distinct rows). The table returned will be the same regardless of any filters on [CANCEL_CODE].
Do you want a measure to return the number of rows in 'Arrivals' with all filters removed except for [CANCEL_CODE]? Then you could use this measure:
Arr_Movements_no_filter := CALCULATE ( COUNTROWS ( 'Arrivals' ), ALLEXCEPT ( 'Arrivals', Arrivals[CANCEL_CODE] ) )
When ALLEXCEPT is used as a top-level filter argument for CALCULATE, it doesn't return a table as such but has the effect of removing all filters except for the columns specified.
Is that what you were trying to do?
Owen
Hi Shamsuddeen,
When you use ALLEXCEPT as in your example (i.e. not as a top-level filter argument for CALCULATE), it returns an unfiltered table containing all distinct rows of the table specified in the first argument, with the columns in the 2nd arguments onwards excluded from the table.
In your case, ALLEXCEPT('Arrivals',Arrivals[CANCEL_CODE]) returns an unfiltered 'Arrivals' table with the [CANCEL_CODE] column removed (reduced to distinct rows). The table returned will be the same regardless of any filters on [CANCEL_CODE].
Do you want a measure to return the number of rows in 'Arrivals' with all filters removed except for [CANCEL_CODE]? Then you could use this measure:
Arr_Movements_no_filter := CALCULATE ( COUNTROWS ( 'Arrivals' ), ALLEXCEPT ( 'Arrivals', Arrivals[CANCEL_CODE] ) )
When ALLEXCEPT is used as a top-level filter argument for CALCULATE, it doesn't return a table as such but has the effect of removing all filters except for the columns specified.
Is that what you were trying to do?
Owen
Thanks! you saved my life
Thanks. I was able to solve.
Br,
Shamsu
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |