Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
TJK
Helper I
Helper I

Group By Calculated Column

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.

 

IDIs LoyalIs Loyal v2
1YesNo
1YesNo
1YesNo
1NoNo
1YesNo
2YesNo
2NoNo
2YesNo
2YesNo
2YesNo
3YesYes
3YesYes
3YesYes
3YesYes
3YesYes
1 ACCEPTED SOLUTION

As a calculated column...

Is Loyal v2 = 
CALCULATE(
    MIN([Is Loyal]),
    ALLEXCEPT(loyalTable, loyalTable[ID])
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

4 REPLIES 4
ahadkarimi
Solution Specialist
Solution Specialist

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.

ahadkarimi
Solution Specialist
Solution Specialist

@TJK 

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])
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.