Iterating/Looping DAX function

Good Day,

I require some assistance with developing a DAX measure for the following scenario:

I want determine what % saving multiple projects have on a sites total energy consumption.

For example:

Each projects has a savings %, but as you iterate through each project, the value of the energy consumed is now less

(i.e.: project 1 saves 10 %, and project 2 saves a further 5%, however project 2’s percentage saving of 5 % is on 90% (100% - Project 1’s savings %).

I believe the measure is something like:
Total Energy x (1 - (1 - Project 1’s % ) x (1 - Project 2’s % )…) etc.

This measure will need to be dynamic to count the total projects per site.

Any help would be greatly appreciated

Hello @Akshay_05,

Thank You for posting your query onto the Forum.

Well, this similar sort of query was asked onto the Forum just few days back by one of our member. I’m providing a link of that solution about how it was achieved. It also contains the working of my PBIX file which you can download it for your reference.

Hoping you find this useful and meets your requirements that you’ve been looking for. :slightly_smiling_face:

Note: In order to view the entire post, please click onto the link and not onto the “Expand/Collapse” button.

Thanks and Warm Regards,
Harsh

Hi @Harsh,

Thanks for the link.

However, I see the link to the solution is not Dynamic.

Is there any way to get the measure to dynamically iterate or count through the projects available?

Hello @Akshay_05,

Please provide the mock up of the file alongwith the results that you’re expecting and accordingly we’ll be in a position to provide the results. Since in the given link, the solution was provided according to the requirements mentioned.

Thanks and Warm Regards,
Harsh

Thanks for posting your question @Akshay_05. To receive a resolution in a timely manner please make sure that you provide all the necessary details on this thread.

Here is a potential list of additional information to include in this thread; demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

Including all of the above will likely enable a quick solution to your question.

@Akshay_05 Hey Mate ,
You can use below link on dynamic filtering in power bi Dynamic filtering

Thank you

Hi @Akshay_05, we’ve noticed that no response has been received from you since the 21st of October. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the checkbox. Thanks!

Hi @Akshay_05, due to inactivity, we have tagged this post as SOLVED. If you feel the need to activate the post, we suggest creating a new topic to get a better response from the community. Thanks!