Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
I have a table say Student and my input source table is as shown below :-
Input Source :
Building | Floor | Attendance | TotalSeats |
A | Floor1 | 2 | 10 |
A | Floor2 | 4 | 10 |
A | Floor3 | 15 | 20 |
B | Floor2 | 1 | 5 |
B | Floor5 | 6 | 10 |
C | Floor1 | 7 | 15 |
C | Floor7 | 18 | 20 |
Rows to be removed :(Highlighted as Bold)
Building | Floor | Attendance | TotalSeats |
A | Floor1 | 2 | 10 |
A | Floor2 | 4 | 10 |
A | Floor3 | 15 | 20 |
B | Floor2 | 1 | 5 |
B | Floor5 | 6 | 10 |
C | Floor1 | 7 | 15 |
C | Floor7 | 18 | 20 |
Expected Output:
Building | Floor | Attendance | TotalSeats |
A | Floor1 | 2 | 10 |
A | Floor3 | 15 | 20 |
B | Floor5 | 6 | 10 |
C | Floor1 | 7 | 15 |
Is there any DAX query or any other method anyone can suggest to remove/delete the selected rows ?
I want to display the expected output in my Table Matrix visual.
How can I remove the unwanted rows using tranformation in PowerBI?
Please suggest.
Kind regards
Sameer
Solved! Go to Solution.
@deb_power123 , you can create a flag in power query or dax and remove those
power query
if ( [Building] ="A" and [floor] = "Floor2" ) or ( [Building] ="B" and [floor] = "Floor2" )
or ( [Building] ="C" and [floor] = "Floor18" ) then 0 else 1
filter all 0 rows in power query and save
In dax
if (( [Building] ="A" && [floor] = "Floor2" ) || ( [Building] ="B" && [floor] = "Floor2" )
|| ( [Building] ="C" && [floor] = "Floor18" ) ,0 ,1)
filter this at visual or page level, if you create a flag in DAX
@deb_power123 , you can create a flag in power query or dax and remove those
power query
if ( [Building] ="A" and [floor] = "Floor2" ) or ( [Building] ="B" and [floor] = "Floor2" )
or ( [Building] ="C" and [floor] = "Floor18" ) then 0 else 1
filter all 0 rows in power query and save
In dax
if (( [Building] ="A" && [floor] = "Floor2" ) || ( [Building] ="B" && [floor] = "Floor2" )
|| ( [Building] ="C" && [floor] = "Floor18" ) ,0 ,1)
filter this at visual or page level, if you create a flag in DAX
I used second approach and it worked as expected
User | Count |
---|---|
23 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |