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.
Hi,
I know im being stupid but this is driving me crazy.
Based on the below data i would like to retrieve all lines where one of the lines has "Flag" = 1. I have included what the results should look like below.
Example Data
ID | Flag | City | Date | Amount |
1 | 0 | Timbuktu | 15/12/2019 | 499 |
1 | 0 | Timbuktu | 15/12/2019 | 162 |
1 | 0 | Timbuktu | 15/12/2019 | 306 |
2 | 0 | Dubai | 15/12/2019 | 107 |
2 | 0 | Dubai | 15/12/2019 | 370 |
2 | 1 | Vatican City | 20/12/2019 | 358 |
8 | 0 | Dubai | 15/12/2019 | 46 |
8 | 0 | Dubai | 15/12/2019 | 45 |
8 | 0 | Dubai | 15/12/2019 | 144 |
8 | 0 | Dubai | 15/12/2019 | 914 |
8 | 1 | Dubai | 15/12/2019 | 817 |
8 | 0 | Dubai | 15/12/2019 | 737 |
Required Result
ID | Flag | City | Date | Amount |
2 | 0 | Dubai | 15/12/2019 | 107 |
2 | 0 | Dubai | 15/12/2019 | 370 |
2 | 1 | Vatican City | 20/12/2019 | 358 |
8 | 0 | Dubai | 15/12/2019 | 46 |
8 | 0 | Dubai | 15/12/2019 | 45 |
8 | 0 | Dubai | 15/12/2019 | 144 |
8 | 0 | Dubai | 15/12/2019 | 914 |
8 | 1 | Dubai | 15/12/2019 | 817 |
8 | 0 | Dubai | 15/12/2019 | 737 |
Big thanks in Advance!
Solved! Go to Solution.
Hi @BigBadBob
Create a calculated column that will say whether the row is to be shown:
ShowLine =
VAR res_ = CALCULATE(SUM(Table1[Flag]);ALLEXCEPT(Table1;Table1[ID]))
RETURN
IF ( res_ > 0; "YES"; "NO")
Then place all the fields you want to show in a Table visual and filter for ShowLine = "YES"
It can also be done with a measure for the filtering, instead of a calculated column
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Hi @BigBadBob ,
Please share sample data for both the tables and the relationship between them.
Regards,
Harsh Nathani
Hi @BigBadBob ,
Hi @BigBadBob
Create a calculated column that will say whether the row is to be shown:
ShowLine =
VAR res_ = CALCULATE(SUM(Table1[Flag]);ALLEXCEPT(Table1;Table1[ID]))
RETURN
IF ( res_ > 0; "YES"; "NO")
Then place all the fields you want to show in a Table visual and filter for ShowLine = "YES"
It can also be done with a measure for the filtering, instead of a calculated column
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Hi - Massive thanks. The flag number is in another table. I tried using the below as a measure and it has not filtered it correctly. Sorry for not mentioning the second table in the original post
Hi @BigBadBob ,
Please share sample data for both the tables and the relationship between them.
Regards,
Harsh Nathani
Hi,
I constructed a basic model using the criteria we discussed on two tables and it worked. I cant see why it does not work in my first model but i am unable to share it. Thanks in advance and Kudos coming your way 😉
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 |
---|---|
49 | |
26 | |
21 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |