Hello,
I am working through the following tips and tricks video: https://youtu.be/i1kCHZEhnEY?t=1539 and have a question about dynamic metrics.
In his example, he is able to switch between Cost, Revenue, etc.
I want to add another slicer that will change the Y Axis values from one column to another.
Ex)Average Type Table
Dashboard
Data Table
Quantity Type Table
selected_measure = var temp_key = SWITCH( TRUE(), "Kit Quantity" IN ALLSELECTED(QuantityTypeTable[Quantity Type]), "Kit Quantity", "Unit Quantity" IN ALLSELECTED(QuantityTypeTable[Quantity Type]), "Unit Quantity", // Default "Kit Quantity" ) RETURN SWITCH( TRUE(), SWITCH( TRUE(), "Actual" IN ALLSELECTED(AveragingTypeTable[Averaging Type]), CALCULATE(SUM('DataTable'[temp_key])), // Pretend the rolling average calculates the rolling average... "Rolling Average" IN ALLSELECTED(AveragingTypeTable[Averaging Type]), CALCULATE(SUM('DataTable'[temp_key])), CALCULATE(0) ) )
I want to be able to use a dynamic column so that I can use one LINE GRAPH and switch between the kit/unit quantity and the type of Y values (based on averaging or actual values).
How do I make my calculation function dynamic such that it takes temp_key and uses that string as the column name in DataTable (for the red text)?
Thanks!
Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.
Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!
Join the biggest FREE Business Applications Event in LATAM this February.
User | Count |
---|---|
96 | |
80 | |
43 | |
32 | |
29 |
User | Count |
---|---|
134 | |
94 | |
90 | |
46 | |
42 |