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, I have a dataset that looks something like this:
what i need to do is for every row i need to compare, if the plant code apears in repeated ocasions in the table with the 3 different zones, i need the 3rd column to say "True" but if it only apears in 2 different zones or in just one, then it should return false... in this example the result should be something like this:
in the table, the plant 1010 appears for the 3 zones, also the plant 1011, ppears on the 3 zones but the rest of the plants appears just in one or two zones, even thought they appear multiple times in the table.
thanks for your help.
Solved! Go to Solution.
Ok. In Dax using a calculated Column
Flag = IF ( COUNTROWS ( SUMMARIZE ( FILTER ( Table1, Table1[Plant Code] = EARLIER ( Table1[Plant Code] ) ), Table1[Plant Code], Table1[Zone] ) ) >= 3, "True", "False" )
Create a Column:
True or False = IF(
CALCULATE(
DISTINCTCOUNT(Table1[Zone]
),
ALLEXCEPT(Table1,Table1[Plant Code]
)
)>2,TRUE(),FALSE()
)
Hi, I would accept wichever solution that you could bring to me... If one of them is easier, i would preffer that one.
Thanks
I'd use the query editor for this task. Use transformation steps to create a table with 3 columns for each region containing the [Plant Code]. The result should leave NULL values for regions with no plants. This is an improved approach, since the boolean column in your design only identifies plants with a missing region, but does not identify which regions need plants.
Here is a good guide on how to use the transformation steps:
https://powerbi.microsoft.com/en-us/guided-learning/powerbi-learning-1-5-cleaning-irregular-data/
Ok. In Dax using a calculated Column
Flag = IF ( COUNTROWS ( SUMMARIZE ( FILTER ( Table1, Table1[Plant Code] = EARLIER ( Table1[Plant Code] ) ), Table1[Plant Code], Table1[Zone] ) ) >= 3, "True", "False" )
This gives me the exact solution for what i wanted, do you have any idea of how i can make the format do a calculation for the ones that are true?
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 |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
145 | |
108 | |
107 | |
89 | |
61 |