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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
koray
Helper V
Helper V

Help Calculation With filter

Hello,

 

lotsayısı.JPG

I want to calculate the number of different "Lotno" that has each different "product no" and ending with the letters "G" and "S".

 

As an example, the calculation result of the above table should be 3.

 

Thank you,

Koray

1 ACCEPTED SOLUTION

Hi @koray ,

I just created a sample pbix file and update the formula of measure(see attachment), please check whether that is what you want. If no, please provide more sample data and your desired result. Thank you.

desired result.JPG

Best Regards
Rena
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

11 REPLIES 11
FrankAT
Community Champion
Community Champion

Hi @koray 

what about the following solution:

 

23-10-_2020_12-59-06.png

 

Number of Lotno G or S = 
CALCULATE(
    COUNTROWS('Table'), 
    RIGHT('Table'[Lotno],1) = "S" || RIGHT('Table'[Lotno],1) = "G"
)

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Hi @FrankAT 

It's worked thank you 🙂 But how can we do the calculation in a unique way.
In addition, I want to calculate the number of different "Lotno" that each different "product no" has.
If batch no, depending on the same product no, the result should be 1. The following table does not count as colored red.

koray_0-1603461149263.png

 

FrankAT
Community Champion
Community Champion

Hi @koray 

sorry I can't follow your logic. This it what I get:

23-10-_2020_16-19-56.png

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Hi @FrankAT 

 

Thank you for reply. The calculation result should be 3. Because there is one more of the product no and batch no, which are marked in Red. I want it to compare product no with batch no and calculate unique ones.

 

 

koray_0-1603694444642.png

 

Hi @koray ,

Please update the formula of measure which @FrankAT  provided as below and check whether you can get the desired result:

Count of Lotno with letter G or S = CALCULATE(COUNTROWS(DISTINCT('Products')), RIGHT('Products'[Lotno],1) = "S" || RIGHT('Products'[Lotno],1) = "G")

Best Regards
Rena
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yiruan-msft 

Thank you for reply. calculated the result as 2 😞 

I think it calculated as 1 because 2 same lot numbers are the same. But I want it to calculate as 2 because the product numbers are different.

Hi @koray ,

I just created a sample pbix file and update the formula of measure(see attachment), please check whether that is what you want. If no, please provide more sample data and your desired result. Thank you.

desired result.JPG

Best Regards
Rena
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Pragati11
Super User
Super User

Hi @koray ,

 

Can you paste a screenshot around the expected output table?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi @Pragati11 
I think there is a problem with the forum. The picture should be  visible, now.

Hi @koray ,

 

I still don't see the output picture.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

@Pragati11 

 

Oh, sorry. No need for a output picture. I want to make a calculation, the result of the output will be 3.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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