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
ChadGalicia
Frequent Visitor

How to properly count the "Y"?

Dear Experts,

 

I have a measure to compute for the variance of cost/unit of current from the previous cost/unit.

The problem that I encounter is the count card doesn't reflect the correct numbers based on the table.

Here's the dax that I wrote Count of Y = COUNTAX(KE30,KE30[limit reached?]="Y")

I tried different approaches which can be found also in the pbix file but the dax returns error.

 

I have attached the image and also the pbix for your reference.

ChadGalicia_0-1688092692593.png

here's the pbix file

 

Your help is much appreciated.

Thank you.

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

Please find attached my PBI file.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

ChadGalicia
Frequent Visitor

@Ashish_Mathur Thanks for your dax somehow I was able to revise your code and make it work somehow.

 

1 Count of Y =
COUNTROWS(
    FILTER(
        SUMMARIZE(
            GENERATE('Calendar', KE30),
            'Calendar'[Date],
            KE30[Product Code],
            KE30[Plant Code],
            "ABCD", [limit reached?]
        ),
        [ABCD] = "Y"
    )
)

View solution in original post

4 REPLIES 4
ChadGalicia
Frequent Visitor

@Ashish_Mathur Thanks for your dax somehow I was able to revise your code and make it work somehow.

 

1 Count of Y =
COUNTROWS(
    FILTER(
        SUMMARIZE(
            GENERATE('Calendar', KE30),
            'Calendar'[Date],
            KE30[Product Code],
            KE30[Plant Code],
            "ABCD", [limit reached?]
        ),
        [ABCD] = "Y"
    )
)

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Please find attached my PBI file.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you so much for this.

I can see that it counted the unique product codes but, currently, the goal is to count the occurrence of Y.

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.

June 2025 community update carousel

Fabric Community Update - June 2025

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