Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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
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.
@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.
Proud to be a Super User! |
|
@ 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.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |