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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Count multiple specific numbers of values in a row

Hey guys

 

I'm quit new in DAX and i'm working on a report which I have no idea how to solve. Its the following problem:

 

benjaminstalder_1-1599557469121.png

 

What do I need?

 

I want to have an extra colum with the following rule:

 

Yes: If the colums Budget, Fortschritt, Risiken, Ressourcen and Termin contain one or more of the number "3" AND three or more of the number 2. So if either of them applies, it should give out a "yes"

 

No: if the rule above does not apply

 

The rows which are marked yellow in the example should have a yes, and the last one should have a now.

 

Thanks for the help!

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,

Try a new column like

switch ( True(),
[Budget] >=3 || [Fortschritt]>=3 || [Risiken]>=3 || [Ressourcen]>=3 || [Termin]>=3 , "Yes",
if([Budget]=2,1,0) + if([Fortschritt]=2,1,0) + if([Risiken]=2,1,0) + if([Ressourcen]=2,1,0) + if([Termin]=2,1,0) >=3, "Yes",
"No"
)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous ,

Try a new column like

switch ( True(),
[Budget] >=3 || [Fortschritt]>=3 || [Risiken]>=3 || [Ressourcen]>=3 || [Termin]>=3 , "Yes",
if([Budget]=2,1,0) + if([Fortschritt]=2,1,0) + if([Risiken]=2,1,0) + if([Ressourcen]=2,1,0) + if([Termin]=2,1,0) >=3, "Yes",
"No"
)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Thanks @amitchandak  for the quick answer. I tested it and it works perfectly!!

 

 

harshnathani
Community Champion
Community Champion

Hi @Anonymous 

 

Try this as a Calculated Column

 

New Column =
SWITCH (
    TRUE (),
    Table[Budget]
        || Table[Fortschritt]
        || Table[Risiken]
        || Table[Ressourcen]
        || Table[Termin] = 3, "Yes",
    Table[Budget] + Table[Fortschritt] + Table[Risiken] + Table[Ressourcen] + Table[Termin] >= 8, "Yes",
    "No"
)

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.