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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Dora
Helper I
Helper I

Custom Visual Issue

Dear All,

 

I want to make a circular gauge ,I used following published code to make it

https://github.com/maqsoftware/PowerBI-visuals/tree/master/src/CustomVisuals/Published/CircularGauge

But I get following error" Cannot find name '_'."as in image .

I add the following 

npm install lodash --save

typings install dt~lodash --save

but still not working.

 

Please help since I am new to coding world.

 

Thank You In Advance,

Best Reagrds,

Dora

 

Capture.PNG

1 ACCEPTED SOLUTION
v-viig
Community Champion
Community Champion

ES2015 modules are not supported by Power BI Csutom Visuals Tools (pbiviz).

 

We'd recommend to use older version of lodash and lodash types:

 

npm i @types/d3@3.5.36 d3@3.5.5

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

4 REPLIES 4
v-viig
Community Champion
Community Champion

Did you include a link to lodash.d.ts into tsconfig.json?

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Yes , I insatll the lodash from this:-npm install --save lodash @types/lodash,but cannot find the "lodash.d.ts" file.Now I get the error as follows.

Best regards,

Dora

 

Capture 2.PNG

solved it by adding following code to the loadsh.d.ts file
 
import * as _ from 'lodash'

declare global{
var _:_.LoDashStatic & {
remove<T, K extends keyof T>(
object: T,
key?: K,
defaultValue?: T[K]
): T[K]
getKeyByValue(object, value)
mapIfDefined(array, func)
mod(n, m)
move(array, oldIndex, newIndex)
pick<T, K extends keyof T>(obj: T, ...keys: K[]): Pick<T, K>
}
}
 
Now I am getting following errorc4.PNG
 
Best Regards,
Dora
v-viig
Community Champion
Community Champion

ES2015 modules are not supported by Power BI Csutom Visuals Tools (pbiviz).

 

We'd recommend to use older version of lodash and lodash types:

 

npm i @types/d3@3.5.36 d3@3.5.5

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.