web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How can I Count true o...
Power Apps
Answered

How can I Count true or false for long datasets?

(0) ShareShare
ReportReport
Posted on by 411

Hello Community!

 

I'm having trouble with a bit column from sql, that column marks if a piece is scrap or not if its 1 it counts the piece as Scrap if it's 0 it counts the pieces as OK

 

I want to count all the rows that have a 1 and 0 from my column only from today date, is it possible to do that?

 

HectorOlivos_0-1689018814098.png

 

Currently Im using this formula but it´s not working: 

 

CountIf(
 FORD_Characteristics,
 FechaDetección = Text(Today(), "[$-en-US]yyyy-mm-dd") && (Scrap_PzaBuena = 0)
)

 

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    Hi @HectorOlivos ,

     

    Could you try updating the formula with a DateValue function if FechaDetección is being read as a Date?

     

     

    CountIf(
     FORD_Characteristics,
     Scrap_PzaBuena = 0,
     FechaDetección = DateValue(Text(Today(), "[$-en-US]yyyy-mm-dd"))
     )

     

     

    Assuming FechaDetección is Text, are you sure the format of "yyyy-mm-dd" matches that column?

    On a related note, direct filters on dates are not delegable with SQL server. There is a workaround documented by Microsoft linked below:

     

    https://learn.microsoft.com/en-us/connectors/sql/#power-apps-functions-and-operations-delegable-to-sql-server 

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

  • HectorOlivos Profile Picture
    411 on at

    Hi @Amik

     

    Thanks for the answer. However it's not working at all:

     

    HectorOlivos_0-1689021264102.png

     

    in top labels I'm using the formula you helped me with, but its returning 0

     

    The labels below where is a 4 and 1996 I use this formula:

     

     

    Sum(
     FORD_Characteristics,
     Scrap_PzaBuena = true
    )

     

     

    from the formula you gave me I removed this part and worked 🙂

     

    FechaDetección = DateValue(Text(Today(), "[$-en-US]yyyy-mm-dd"))

     

    I think the date column is causing the issue

     

  • Verified answer
    Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @HectorOlivos  as mentioned, dates are not delegable with SQL server.

     

    Consider using:

     

    ALTER TABLE myTable ADD DateAsInt AS (YEAR([date]) * 10000 + MONTH([date]) * 100 + DAY([date]))

    Then filter on that number column instead.

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

  • HectorOlivos Profile Picture
    411 on at

    Yep, now it worked thanks

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard