The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello Folks
I have a simple measure to calculate the percentage accuracy of the cost of stock counted
% value accuracy=
DIVIDE(
SUM(actualcost)
SUM(system cost)
in some cases the % comes back as over 100%. How do I write the measure so that it switches the calculation in those cases?
Thanks
Bailey14
Solved! Go to Solution.
Hi,
You can write like below
% value accuracy=
if(
DIVIDE(
SUM(actualcost)
SUM(system cost),0) >1 then
DIVIDE(
SUM(system cost),SUM(actualcost),0) ,
DIVIDE(
SUM(actualcost)
SUM(system cost),0))
Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂
Regards,
N V Durga Prasad
Hi @Anonymous ,
What is the correct result? How to deal with it when the returned value of measure "% value accuracy" is over 100%? Could you please explain it with examples? Please check if the below formula is what you want:
% value accuracy =
VAR _per =
DIVIDE ( SUM ( [actualcost] ), SUM ( [system cost] ) )
RETURN
IF ( _per > 1, 1, _per )
Best Regards
Rena
Hi @Anonymous
Yes, I'm looking for the measure to deal with the result by switching the formula around if the result is over 100%, as I'm new to writing measures I don't know how to express it in the dax.
I tried your solution but VAR _per couldn't be found? There was another solution which worked so the problem has been solved.
Thank you for your time
Regards
Bailey14
Hi,
You can write like below
% value accuracy=
if(
DIVIDE(
SUM(actualcost)
SUM(system cost),0) >1 then
DIVIDE(
SUM(system cost),SUM(actualcost),0) ,
DIVIDE(
SUM(actualcost)
SUM(system cost),0))
Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂
Regards,
N V Durga Prasad
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
27 |
User | Count |
---|---|
181 | |
83 | |
68 | |
49 | |
46 |