March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I would like the visual to take the total number of Inspections per month, add them, and show me the percentage (by month) of how many are on time. When I use "show percentage" option, it shows overall instead of by month. What kind of Measure formula can I use so that it calculates this for me?
My data with counts of Inspections:
What Power BI does:
But I want it to say January = 79%, February =84%, etc.
January = 30/38
February = 38/45
etc.
If it helps... my spreadsheet/datasource is something like this:
Column A = Inspection number (unique identifier)
Column B = Date
Column C = On-Time or Past Target
Solved! Go to Solution.
Hi @abeiswinger,
I reproduced you data and created this measure ( for details check pictures below):
Rat = DIVIDE(CALCULATE(SUM(TestData[OTT]),FILTER(TestData,TestData[Descr]="On Time")),CALCULATE(SUM(TestData[OTT])))
Please refer to the steps below to acheive your requirement.
Regards,
Charlie Liao
Please refer to the steps below to acheive your requirement.
Regards,
Charlie Liao
So close! For some reason all my data now displays as the same?? Screenshot below of what it looks like with the measure, as well as what I have in my Visualizations... how can this be corrected? My January data should be 79% and February should be 84%, etc...
Hi @abeiswinger,
I reproduced you data and created this measure ( for details check pictures below):
Rat = DIVIDE(CALCULATE(SUM(TestData[OTT]),FILTER(TestData,TestData[Descr]="On Time")),CALCULATE(SUM(TestData[OTT])))
Sorry, this formula is not working for me. Can you please explain what each value is supposed to be? I'm not sure where data is being pulled from:
Rat = DIVIDE(CALCULATE(SUM(TestData[OTT]),FILTER(TestData,TestData[Descr]="On Time")),CALCULATE(SUM(TestData[OTT])))
I'm assuming that anything that says [TestData[OTT] = the name of the tab (from Excel datasource) and the title of the column that I want to pull the "On-Time" or "Past Target" from?
So in the red, and blue, and green text... I change to mine. However, what should I input for the blue bold text? if I only put the tab name, I recieve an error message: MdxScript(Model) (3,46) Calculation error in measure 'WO Detail'[RAT]: The function SUM cannot work with the values of type String.
WO Detail is the name of my tab.
Hi @abeiswinger,
You are trying to sum up a string value.
'WO Detail'[RAT]: The function SUM cannot work with the values of type String.
Please change the type of data for example to Whole number or Decimal ones, etc...
From what you told me, the formula will be :
Rat = DIVIDE(CALCULATE(SUM('WO Detail'[RAT]:),FILTER('WO Detail','WO Detail'[the field you have on time]="On Time")),CALCULATE(SUM('WO Detail'[RAT])))
Furthermore a sample could help if you cannot apply this formula to your model.
Please dont hesitate if I can help.
Thx, Ninter
What do you mean by "Please change the type of data for example to Whole number or Decimal ones, etc..."
Do I leave the [RAT] in the formula, or should that be changed as well?
Thanks
Hi @abeiswinger.
Your column named RAT is a string ( for example your name and surname you cannot add them as a sum).
And this is whqt you qre trying to do.
Select the column is PowerQuery for example and change the data type.
Let us know.
Thanks
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |