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.
Hello everyone,
I need help with a code in Power Bi.
I have 2 columns. In column 1 I have numbers in it, which can also repeat:
23 true
62 false
55 true
23 true
23 false
42 false
...
In column 2, a true or false value is stored for each number.
What is the code for the new column if I add up all the same numbers in column 1 and then want to check that if only one of the group of numbers added up is false, they are all false in the group of numbers?
It should look like this:
Column 1 / Column 2 / New column
23 true false
62 false false
55 true true
23 true false
23 false false
42 false false
52 true true
6 true true
...
I am grateful for any help!
Solved! Go to Solution.
Hi @Dominik-1988 ,
Please follow these steps:
Column =
CALCULATE (
COUNT ( 'Table'[number] ),
FILTER ( 'Table', 'Table'[number] = EARLIER ( 'Table'[number] ) )
)
Column 2 =
VAR _1 =
IF ( 'Table'[Column] > 1, 'Table'[t or f], BLANK () )
RETURN
MAXX ( FILTER ( 'Table', 'Table'[number] = EARLIER ( 'Table'[number] ) ), _1 )
result =
VAR _1 =
MINX (
FILTER ( 'Table', 'Table'[number] = EARLIER ( 'Table'[number] ) ),
'Table'[Column 2]
)
RETURN
IF ( 'Table'[Column] = 1, 'Table'[t or f], _1 )
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Yifan Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Dominik-1988 ,
Please follow these steps:
Column =
CALCULATE (
COUNT ( 'Table'[number] ),
FILTER ( 'Table', 'Table'[number] = EARLIER ( 'Table'[number] ) )
)
Column 2 =
VAR _1 =
IF ( 'Table'[Column] > 1, 'Table'[t or f], BLANK () )
RETURN
MAXX ( FILTER ( 'Table', 'Table'[number] = EARLIER ( 'Table'[number] ) ), _1 )
result =
VAR _1 =
MINX (
FILTER ( 'Table', 'Table'[number] = EARLIER ( 'Table'[number] ) ),
'Table'[Column 2]
)
RETURN
IF ( 'Table'[Column] = 1, 'Table'[t or f], _1 )
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Yifan Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
106 | |
105 | |
79 | |
68 | |
61 |
User | Count |
---|---|
143 | |
104 | |
103 | |
82 | |
70 |