Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I have a data set that looks like this:
| Case | Working hours between | In time? Y=1, N=0 |
| 1 | 32 | 0 |
| 1 | 4 | 1 |
| 2 | 3 | 1 |
| 2 | 3 | 1 |
| 3 | 2 | 1 |
| 4 | 1 | 1 |
| 4 | 7 | 1 |
| 4 | 21 | 0 |
| 5 | 4 | 1 |
And I need to report a total % of timeliness to a client.
So I should get these % per case:
Case 1 = (0+1)/2 = 50%
Case 2 = (1+1)/2 = 100%
Case 3 = 100%
Case 4 = (1+1+0)/3 = 66.66%
Case 5 = 100%
So I should report: (50%+100%+100%+66.66%+100%)/5 = 83,332%
What is the best way to do this in PowerBI?
Thanks.
Solved! Go to Solution.
Hi @bvbuijs ,
You are missing parentheses,modify your measure as below:
Timeliness1_Percentage =
DIVIDE (
SUMX (
VALUES ( 'Cases Dump'[CaseNumber] ),
DIVIDE (
CALCULATE ( SUM ( 'Cases Dump'[Timeliness 1] ) ),
CALCULATE ( COUNTROWS ( 'Cases Dump' ) )
)
),
COUNTROWS ( VALUES ( 'Cases Dump'[CaseNumber] ) )
)
Hi @bvbuijs ,
Create 2 measures as below:
_percentage =
var _sum=SUMX(FILTER(ALL('Table'),'Table'[Case]=MAX('Table'[Case])),'Table'[In time? Y=1, N=0])
var _count=CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Case]=MAX('Table'[Case])))
Return
DIVIDE(_sum,_count)Measure 2 =
var _table=SUMMARIZE('Table','Table'[Case],"_percentage",[_percentage])
var _sum=SUMX(_table,[_percentage])
var _count=CALCULATE(DISTINCTCOUNT('Table'[Case]),ALL('Table'))
Return
DIVIDE(_sum,_count)
And you will see:
For the related .pbix file,pls see attached.
@bvbuijs , Try a new column
New Column = divide(sumx(filter(Table, [Case] = earlier([Case]) ),[ between In time]),countx(filter(Table, [Case] = earlier([Case]) ),[ between In time]))
@bvbuijs try this measure
DIVIDE (
SUMX ( VALUES ( Table[Case] ),
DIVIDE (
CALCULATE ( SUM ( Table[InTime] ),
CALCULATE ( COUNTROWS ( Table ) )
)
),
COUNTROWS ( VALUES ( Table[Case] ) )
)
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi,
@parry2k : I receive an error message when using this formula: "Too few arguments were passed to the DIVIDE function. The minimum argument count for the function is 2".
My formula looks like this:
Timeliness1_Percentage = DIVIDE (SUMX ( VALUES ('Cases Dump'[CaseNumber]), DIVIDE (CALCULATE ( SUM ('Cases Dump'[Timeliness 1]), CALCULATE (COUNTROWS ('Cases Dump')))), COUNTROWS (VALUES ('Cases Dump'[CaseNumber]))))
How can I solve this?
Hi @bvbuijs ,
You are missing parentheses,modify your measure as below:
Timeliness1_Percentage =
DIVIDE (
SUMX (
VALUES ( 'Cases Dump'[CaseNumber] ),
DIVIDE (
CALCULATE ( SUM ( 'Cases Dump'[Timeliness 1] ) ),
CALCULATE ( COUNTROWS ( 'Cases Dump' ) )
)
),
COUNTROWS ( VALUES ( 'Cases Dump'[CaseNumber] ) )
)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.