Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Himaja95
Helper I
Helper I

Powerbi

Hi

 

I am getting this error,when i am trying calculate the targets

error:

Calculation error in measure targets_Ridership(Bus _Ridership_Green):A table of multiple values were supplied ,where a single value was expected

 

Code

SystemWide_Green = CALCULATE(VALUES(targets_Ridership[Target Threshold - Green]),FILTER(targets_Ridership, targets_Ridership[PM] = "Systemwide Ridership"))

 

This is the data:

MonthYearCategoryPMTarget DescriptionTarget Threshold - GreenTarget Threshold Yellow
January2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
February2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
March2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
April2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
May2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
June2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
July2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
August2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
September2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
October2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
November2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
December2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
January2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
February2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
March2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
April2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
May2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
June2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
July2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
August2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
September2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
October2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.1040.054
November2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.1040.054
December2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.1040.054
January2024RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.1040.054
1 ACCEPTED SOLUTION

16 REPLIES 16
Ahmedx
Super User
Super User

pls try this

 

 

SystemWide_Green =
 CALCULATE(MAX(targets_Ridership[Target Threshold - Green]),
    KEEPFILTERS(FILTER(ALL(targets_Ridership), 
      targets_Ridership[PM] = "Systemwide Ridership")))
-------or-----------------------
SystemWide_Green =
 CALCULATE(MAX(targets_Ridership[Target Threshold - Green]),
        FILTER(ALL(targets_Ridership), 
              targets_Ridership[PM] = "Systemwide Ridership"))

 

 

Thank you

Unfortunately didn't work for me,the code doesnt give any errors but its not displaying the right numbers

share the file and show the target

Here is the data

Target is cal as 

For eg : 2023 october target is calculated as 1.104 * Previous year(oct2022)

YearMonthCummulativeTargetTarget cal
2021October1932261  
2021November3569184  
2021December5081362  
2022January6442150  
2022February7806165  
2022March9541096  
2022April11264768  
2022May12992642  
2022June14666883  
2022July16334351  
2022August18257345  
2022September20333298  
2022October215045923786131.231
2022November401694643936661.231
2022December576540662551571.231
2023January771095579302871.231
2023February952887796093891.231
2023March11717531117450891.231
2023April13723072138669291.231
2023May15755583159939421.231
2023June17696324180549331.231
2023July19648336201075861.231
2023August21872357224747921.231
2023September24179580250302901.231
2023October236897623741071.104
2023November447286044347081.104
2023December638924263650081.104

pls try this

Screenshot_2.png

this worked ,But I have to use the below measure ,which would take the value 1.104 and then I have to calculate the TARGET

SystemWide_Green =
 CALCULATE(MAX(targets_Ridership[Target Threshold - Green]),
    KEEPFILTERS(FILTER(ALL(targets_Ridership), 
      targets_Ridership[PM] = "Systemwide Ridership")))

The actual table is below one fro calcualting the above measure

MonthYearCategoryPMTarget DescriptionTarget Threshold - GreenTarget Threshold Yellow
January2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
February2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
March2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
April2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
May2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
June2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
July2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
August2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
September2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
October2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
November2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
December2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
January2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
February2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
March2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
April2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
May2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
June2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
July2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
August2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
September2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
October2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.1040.054
November2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.1040.054
December2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.1040.054
January2024RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.1040.05

pls try this

 

It worked,I really appreciate your help in resolving this issue.👏

you want to get the last year's sum (2150459) and then multiply by 1.104 ?

How to calculate the Target for october 2023=

Target = 1.104*2150459(october 2022 cummulative)
I wanted to get the TARGET

why did you write this to the measure?
targets Ridership[PM] = "System Wide Ridership"

The column named PM has three metrics in that one of them is System wide ,this refers to this table.

MonthYearCategoryPMTarget DescriptionTarget Threshold - GreenTarget Threshold Yellow
January2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
February2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
March2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
April2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
May2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
June2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
July2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
August2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
September2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
October2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
November2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
December2022RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
January2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
February2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
March2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
April2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
May2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
June2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
July2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
August2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
September2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.2310.181
October2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.1040.054
November2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.1040.054
December2023RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.1040.054
January2024RidershipSystemwide RidershipIncrease from last year, with a 5% tolerance0.1040.054

and try this

SystemWide_Green =
 CALCULATE(SUM(targets_Ridership[Target Threshold - Green]),
    KEEPFILTERS(FILTER(ALL(targets_Ridership), 
      targets_Ridership[PM] = "Systemwide Ridership")))
-------or-----------------------
SystemWide_Green =
 CALCULATE(SUM(targets_Ridership[Target Threshold - Green]),
        FILTER(ALL(targets_Ridership), 
              targets_Ridership[PM] = "Systemwide Ridership"))
Himaja95
Helper I
Helper I

Thank you for your response @Fowmy 

The code worked but its not showing the right numbers in the chart.

Yes I am trying to display the targets. and  little calculation behind displaying the targets

Systems_Ridership_Gauge = ([SystemWide_Green]+1) * [Ridership Total Last Year All Modes]
Ridership total last year is the (FY 2023 Actual ) column.  in the below table
By the above code you sent me its is showing 5.4M instead of 4.1

 

 Ridership Total Last Year All ModesYellow ZoneGreen Target
Oct202458621339142235143
Nov379188739966494186243
Dec544350157374506009625
Jan728439576777528041972
Feb900646394928129943135
Mar110528141164966612202307
Apr129353021363380814280573
May148433101564484916387014
Jun166678211756788318401274
Jul185177371951769520443582
Aug206083482172119922751616
Sept227847812401515925154398

 

Himaja95
Helper I
Helper I

@Idrissshatila  

The code worked but its not showing the right numbers in the chart.

Yes I am trying to display the targets. and  little calculation behind displaying the targets

Systems_Ridership_Gauge = ([SystemWide_Green]+1) * [Ridership Total Last Year All Modes]
Ridership total last year is the (FY 2023 Actual ) column.  in the below table
By the above code you sent me its is showing 5.4M instead of 4.1

 

 Ridership Total Last Year All ModesYellow ZoneGreen Target
Oct202458621339142235143
Nov379188739966494186243
Dec544350157374506009625
Jan728439576777528041972
Feb900646394928129943135
Mar110528141164966612202307
Apr129353021363380814280573
May148433101564484916387014
Jun166678211756788318401274
Jul185177371951769520443582
Aug206083482172119922751616
Sept227847812401515925154398

 

Idrissshatila
Super User
Super User

Hello @Himaja95 ,

 

but what are you trying to calculate, if you're trying to get the sum of this column then try the following measure:

 

SystemWide_Green = CALCULATE(SUM(targets_Ridership[Target Threshold - Green]),FILTER(targets_Ridership, targets_Ridership[PM] = "Systemwide Ridership"))

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors