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
Anonymous
Not applicable

What if parameter to adjust selected row

Hello Everyone,

 

I have a column called Name Short where I have consumption calculatation for each Name Short. Now I want to use What if parameter as User in put, where they can select an specific Name Short and only change they value by the amount they put in What if parameter.

So far, when I select an specific Name short, and when I change the in put, it gets adjusted in my heat map, but when I deselect it and see the whole heatmap, all of the Name shorts have been adjust for the in put.

I would appreciate your help

Arian

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous 

 

May I ask if your problem has been solved? If not, please try the fllowing DAX:

Adjusted Consumption = 
VAR SelectedNameShort = SELECTEDVALUE('ConsumptionData'[Name Short])
VAR AdjustmentValue = SELECTEDVALUE('Adjustment Value'[Adjustment Value])
RETURN
SUMX(
    'ConsumptionData',
    IF(
        'ConsumptionData'[Name Short] = SelectedNameShort,
        'ConsumptionData'[Consumption] + AdjustmentValue,
        'ConsumptionData'[Consumption]
    )
)


If it doesn't work, please provide us with your dummy data or relevant screenshots, which will allow us to understand exactly what you want. Please take care to protect your privacy in the data provided. 

 

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

bhanu_gautam
Super User
Super User

@Anonymous ,

Click on "New Parameter" and create a parameter (e.g., AdjustmentValue) with the desired range and increment.
This will create a new table and a slicer for the parameter.
Create a Slicer for "Name Short":

Add a slicer to your report for the Name Short column. This will allow users to select a specific Name Short.
Create a Measure for Adjusted Value:

You need to create a measure that adjusts the value based on the selected Name Short and the AdjustmentValue parameter.
Here is an example DAX formula for the measure:
DAX
AdjustedValue =
VAR SelectedNameShort = SELECTEDVALUE('YourTable'[Name Short])
VAR Adjustment = SELECTEDVALUE('AdjustmentValue'[AdjustmentValue])
RETURN
IF(
ISBLANK(SelectedNameShort),
SUM('YourTable'[Consumption]), -- Default to sum of consumption if no Name Short is selected
SUMX(

Use the Measure in Your Heatmap:

Replace the original consumption value in your heatmap with the AdjustedValue measure.
This will ensure that the heatmap reflects the adjusted values based on the user input.
Test the Interaction:

Select a specific Name Short from the slicer.
Adjust the AdjustmentValue parameter using the slicer.
Observe the changes in the heatmap. Only the selected Name Short should be adjusted.
Deselecting the "Name Short":

When you deselect the Name Short, the measure should revert to showing the original consumption values for all Name Short.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Anonymous
Not applicable

@ bhanu_gautam

Thank you for your quick reply. I have already done everything you said. I just need the DAX code to solve the changes in selected Name Short. I have used your idea but still it changes everything. And also is there a way that when I deselect the Name Short, it doesnt go back to original count?

Hello @Anonymous,

 

Can you please try the following:

AdjustedValue =
VAR SelectedNameShort = SELECTEDVALUE('YourTable'[Name Short])
VAR Adjustment = SELECTEDVALUE('AdjustmentValue'[AdjustmentValue])
VAR OriginalConsumption = SUM('YourTable'[Consumption])
RETURN
    IF(
        NOT ISBLANK(SelectedNameShort),
        IF(
            MAX('YourTable'[Name Short]) = SelectedNameShort,
            OriginalConsumption + Adjustment,
            OriginalConsumption
        ),
        BLANK()  // When no Name Short is selected, you can return BLANK or the original value as per your requirement
    )

Hope this helps.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
Anonymous
Not applicable

@Sahir_Maharaj 

Thank you, So this is what I used based on your instruction:

AdjustedValue =
VAR SelectedNameShort = SELECTEDVALUE('Material'[Name short])
VAR Adjustment = [UserInPut Value]
VAR OriginalNotOpenedCount = [NotOpenedCount]
RETURN
    IF(
        NOT ISBLANK(SelectedNameShort),
        IF(
            MAX('Material'[Name short]) = SelectedNameShort,
            OriginalNotOpenedCount - Adjustment,
            OriginalNotOpenedCount
        ),
        BLANK()  // When no Name short is selected, returns BLANK
    )

 

The logic is correct, but still it changes everything. I really don't understand what is wrong here

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.