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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Jousterama
New Member

How to update a Graph from Code

I added the code on lines 2, 3, and 4 in the attached image and selected the Check mark. But how does one update the actual Graphics to show the added lines when using PowerBI?

Security Compliance V2.png

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Jousterama 

 

I've simply modelled some data to hopefully fit your situation.

vzhangti_0-1701323736020.png

You can try the following methods. Add a new range table.

vzhangti_1-1701323849073.png

Measure = CALCULATE(COUNT('Table'[Finish in]),FILTER(ALL('Table'),[Finish in]=SELECTEDVALUE(Range[Range])))+0

vzhangti_2-1701323877213.png

Is this the result you expect? Please see the attached document.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Jousterama 

 

I've simply modelled some data to hopefully fit your situation.

vzhangti_0-1701323736020.png

You can try the following methods. Add a new range table.

vzhangti_1-1701323849073.png

Measure = CALCULATE(COUNT('Table'[Finish in]),FILTER(ALL('Table'),[Finish in]=SELECTEDVALUE(Range[Range])))+0

vzhangti_2-1701323877213.png

Is this the result you expect? Please see the attached document.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Jousterama
New Member

The answer - The graphics are not going to show unless there is data in that range. 

Second question - How does one show the graph as Zero when there is no data in that range?

Using the option 'Show items with no data' did not provide an update to the graphic, per the attached. 

Show Items with no data.png

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.