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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
改善
New Member

Dynamic column in dashboard that would recalculate based on parameter value?

A very similar question to this one, but the answer in that thread was not working for me.

https://community.fabric.microsoft.com/t5/Power-Query/What-if-Parameter-for-Only-Selected-Values/td-...

 

Assume a table of the following structure: 

BrandProductAreaCost 2023Cost 2024Required Input
ClockSKU 400UK2024Batteries
ClockSKU 400UK4850Digital Display
ClockSKU 400UK59Plastic Casing
CameraSKU 20China35Sensor
CameraSKU 20China2018Processor
CameraSKU 20China98Plastic Casing

 

 

I want to build a dashboard which would have a table of the following format:

 

_0-1710801892095.png

 

 

Q1. Is it possible to build something where the scenario cost 2024 would be a dynamic column, that would recalculate only when one of the required inputs in the process is selected in the graph in the right hand. ( it doesnt have to be a graph it can be also a dropdown list ) right now it calculates the new cost on all lines. 

 

Q2 And also take it to the next level, have multiple parameters, with custom appliance? i.e. 1 parameters adjusting volumes, 1 parameter adjusting price of X input, another paratmer adjusting price of Y input ( i assume it is possible)

 

Thanks to everyone that has read this far, thanks in advance for your help too! 

4 REPLIES 4
改善
New Member

Hi @v-jianpeng-msft thank you for the solution can u help me further please? I believe i have explained it poorly the first time. 

 

Please see the below screenshot, right now my bar chart selection does not interact with the Matrix. 

 

_0-1710835616251.png

 

The expectation would be that i would select one required input in the bar chart, but my matrix would still show the full overview, without filtering on that requried input but recalculating only that input's value and the rest remain the same. 

In hindsight i probably need a DAX formula that would check IF an input is selected, then for that selected input multiply by (100 + Parameter Value ) otherwise all other inputs equal Cost 2024. 

So how do i make it so that the matrix on the left side show the whole data set, while only amending the inputs that are selected in the bar chart by the paramter? 

 

I hope i have not confused you even more

Hi, @改善 

Thank you very much for your reply. Leaving the other two columns untouched and not filtered by other charts, I created the following DAX expression:

Sum of Cost 2023 =
CALCULATE ( SUM ( 'Table'[Cost 2023] ), ALL ( 'Table 2'[Required Input] ) )
Sum of cost 2024 =
CALCULATE ( SUM ( 'Table'[Cost 2024] ), ALL ( 'Table 2'[Required Input] ) )

Use the ALL function to clear the external filter. I rewrote the measure Scenario 2024:

Scenario 2024 =
IF (
    ISBLANK ( SELECTEDVALUE ( 'Table 2'[Required Input] ) ),
    CALCULATE (
        MAX ( 'Table'[Cost 2024] ) * ( 1 + [Parameter Value] ),
        FILTER ( 'Table', 'Table'[Required Input] = "Sensor" )
    ),
    IF (
        [Sum of Cost 2023] = BLANK ()
            || [Sum of cost 2024] = BLANK (),
        " ",
        CALCULATE ( MAX ( 'Table'[Cost 2024] ) * ( 1 + [Parameter Value] ) )
    )
)

If no other charts are selected by default, one of the inputs is calculated. When the corresponding input is selected in another chart, Scenario 2024 will also be recalculated. The results are shown in the image below:

If it is not checked, there will be a default output:

vjianpengmsft_0-1711677510254.png

When one of the inputs is selected, it is recalculated:

vjianpengmsft_1-1711677567870.png

vjianpengmsft_2-1711677723491.png

 

I've provided the PBIX file used this time below. 

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

 

 

 

Hi Jianpeng,

 

Thank you for the solution, this is somewhat in the direction i need it to be, i have 2 follow up issues/querries please

 

1) Strictly relating to the model you shared with me above, in the case of Scenario 2024, that column should provide the same cost as in the column cost 2024 if that required input is not selected.

 

i.e. that how its behaving now, but plastic casting should also show 8, processor show 18, sensor 5. The logic should be as follows :

 

IF category is selected,

     then for selected required input multiply COST 2024 * Parameter Value,

else for all other required inputs equals cost 2024.

 

 

_1-1712836604191.png

 

Also when 2 or more are selected it stops working. 

 

 

_0-1712836534291.png

 

2) Would it be easier to do this differently? i.e. have 6 parameters a user could change as needed. 

Those 6 parameters would change the values in this table.

 

And then connect this table to the main data through column A primary key, into a new column/measure that would do the cost 2024 multiplied by the parameter value assigned to the required input. 

 

_2-1712836975110.png

 

 

 

Thank you in advance, i know that my question is not quite simple. 

 

v-jianpeng-msft
Community Support
Community Support

Hi, @改善 

Based on your description, I use the following sample data:

vjianpengmsft_0-1710830989970.png

I'm going to use summarize to create a new table with the following parameters:

Table 2 =
SUMMARIZE ( 'Table', 'Table'[Required Input] )

vjianpengmsft_1-1710831088923.png

I have established the following relationship between the original table and the new table:

vjianpengmsft_2-1710831153363.png

I'm using the following DAX to determine if a field in another chart is selected, and if so, Scenario 2024 is calculated:

Scenario 2024 =
IF (
    ISBLANK ( SELECTEDVALUE ( 'Table 2'[Required Input] ) ),
    BLANK (),
    MAX ( 'Table'[Cost 2024] ) * ( 1 + [Parameter Value] )
)

In other charts, use the parameters of the new table:

vjianpengmsft_4-1710831472678.png

Here are the results:

vjianpengmsft_3-1710831324581.png

vjianpengmsft_5-1710831523691.png

I've provided the PBIX file used this time below. You can adjust Scenario 2024 to suit your actual situation and add more conditions to meet your requirements.

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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