Forum Discussion
Percentage help Please
Hello, I was hoping someone could help me please
I have two columns, product and days late. I would like to know what perecentage of what product was late.
So for example 70% of product D was 10 or more days late. 30% of product B was only 1 day late etc.
Could anyone please help me with that?
Thank you in advance.
Pricey79 ,
No problem, we've all been there 🙂
Can you provide a sample of your data with any sensitive information (names, birthdays, addresses etc.) removed in a copyable format (not screenshot) please?
If I can get even 10 or 20 rows of your actual data I'll be able to write the measure exactly as it should be and also give an example of how to set up your report to be easily used.
Pete
6 Replies
- BA_Pete
Super User
Hi Pricey79 ,
I think your base measure would be something like this:
_productPercent = VAR __totalProduct = CALCULATE( COUNT(yourTable[product]), ALLEXCEPT(yourTable, yourTable[product]) ) VAR __selectedProduct = COUNT(yourTable[product]) RETURN DIVIDE( __selectedProduct, __totalProduct, 0)You would then apply this to your visual and the adjustment of how many days late you wanted to see the output for would be driven by a visual/page filter or a slicer on days late.
If there were specific metrics for the number of days late you wanted to see, you could hard code this into the measure and duplicate with different values, but you'd lose the dynamic advatage that this method gives you.
Pete
- Pricey79
Helper V
Thank you for your time , much appreciated
- BA_Pete
Super User
Pricey79 ,
No problem.
Did this solve the problem for you? If so, can you mark the solution as the answer please? This will help others with the same question find an answer quicker.
If I didn't solve your question then feel free to let me know where it's still going wrong and I'll work with you to get it fixed.
Pete