cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Zaky Member
Member

Need Help with a Measure Formula

Hi All,

Wondering if someone would able to help me with a correct formula to count column Quantity as per table below. 

I would like to show quantity of each printer model i KPI card. 

 

Model/Description

Code

Quantity

eStudio3540cse

MFP-2

0

eStudio3540cse

MFP-2

0

eStudio3550cse

MFP-2

1

eStudio3500se

MFP-2

1

 

I'm trying to create a new measure for Quantity column but it doesn't work. 

Count MFP = CALCULATE(COUNTA('Printer'[Qty]),'Printer'[Qty]="1"

 

Expected result of the KPI card should counts only printer with the "1" number.

 

Thanks for your time.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Need Help with a Measure Formula

Hi @Zaky 

Create a measure

Measure = CALCULATE(COUNTA(Table1[Model/Description]),FILTER(ALL(Table1),Table1[Quantity]=1))

10.png

 

Best Regards
Maggie

 

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

suryaburaboyina Frequent Visitor
Frequent Visitor

Re: Need Help with a Measure Formula

Hi,

 

can you please try below measure and mark correct if it works.

 

Count = CALCULATE(COUNT(Sheet2[code]),Sheet2[quantity] = 1)
 
Thanks,
Surya teja
7 REPLIES 7
nsrshkh1 Member
Member

Re: Need Help with a Measure Formula

@Zaky ,

 

Use this formula

 

CountQuantity = CALCULATE(COUNTA(Table1[Model/Description]),FILTER(Table1,Table1[Quantity]="1"))

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

Zaky Member
Member

Re: Need Help with a Measure Formula

Hi,

 

I'm trying created the measure, but it's not working.

 

measure1.JPG

Community Support Team
Community Support Team

Re: Need Help with a Measure Formula

Hi @Zaky 

Create a measure

Measure = CALCULATE(COUNTA(Table1[Model/Description]),FILTER(ALL(Table1),Table1[Quantity]=1))

10.png

 

Best Regards
Maggie

 

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

suryaburaboyina Frequent Visitor
Frequent Visitor

Re: Need Help with a Measure Formula

Hi,

 

can you please try below measure and mark correct if it works.

 

Count = CALCULATE(COUNT(Sheet2[code]),Sheet2[quantity] = 1)
 
Thanks,
Surya teja
Moscuba Member
Member

Re: Need Help with a Measure Formula

However, to eliminate the Zero counts you will need to use the Visualizations Visual Level Filter to eliminate Zero. 

Zaky Member
Member

Re: Need Help with a Measure Formula

@v-juanli-msft 

Yes..  got it!.  The formula is working as per what i expected.

 

Thank you so much !

 

Regards,

ZAKY

Highlighted
Zaky Member
Member

Re: Need Help with a Measure Formula

@suryaburaboyina 

This formula also works accordingly :-)

 

 

Thanks for help.

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 42 members 1,087 guests
Please welcome our newest community members: