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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.