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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.