The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
How would I create the "Is Loyal v2" column in the Table View using DAX based on the first two columns? I want the outcome to equal "No" for all rows if there is a row that equals "No" for the ID in the first column.
I know I can achieve this with Power Query, but wondering if it's possible in the table view.
ID | Is Loyal | Is Loyal v2 |
1 | Yes | No |
1 | Yes | No |
1 | Yes | No |
1 | No | No |
1 | Yes | No |
2 | Yes | No |
2 | No | No |
2 | Yes | No |
2 | Yes | No |
2 | Yes | No |
3 | Yes | Yes |
3 | Yes | Yes |
3 | Yes | Yes |
3 | Yes | Yes |
3 | Yes | Yes |
Solved! Go to Solution.
As a calculated column...
Is Loyal v2 =
CALCULATE(
MIN([Is Loyal]),
ALLEXCEPT(loyalTable, loyalTable[ID])
)
Proud to be a Super User! | |
Hi @TJK, go to Modeling ->New column
Is Loyal v2 =
IF(
CALCULATE(
COUNTROWS('Table'),
'Table'[ID] = EARLIER('Table'[ID]),
'Table'[Is Loyal] = "No"
) > 0,
"No",
"Yes"
)
Did I answer your question? If so, please mark my post as the solution!✔️
Your Kudos are much appreciated! Proud to be a Responsive Resident!
Hi @ahadkarimi ,
You're formula is giving me the same result as the "Is Loyal" column. It's only showing "No" when "Is Loyal" is equal to "No". I would like it to show "No" for all rows for the given ID.
Is Loyal v2 =
IF(
CALCULATE(
COUNTROWS('Table'),
'Table'[ID] = EARLIER('Table'[ID]),
'Table'[Is Loyal] = "No"
) > 0,
"No",
"Yes"
)
As a calculated column...
Is Loyal v2 =
CALCULATE(
MIN([Is Loyal]),
ALLEXCEPT(loyalTable, loyalTable[ID])
)
Proud to be a Super User! | |
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |