Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello
I am trying to create something like the formula pic below to dynamically switch a measure in a chart.
I have everything except I am struggling to understand how to caculate the purple part below. I am not calculating anything- All I want to achive is when I select something on the slicer, it changes the measure I want to use. So If I select "Total Sales" if references a measure I have. I beleive I need to just create a new measure referencing the measures I want to use- But becuase I am not doing a calcuation, I dont know what syntax to use.
My use case is
I have three items in a table.
Product
Package
Customer
I want the user to be able to select a slicer value and then the table updates dynamically with the Dynamical Measure where it pulls in the Meausre for Product, Package, or Customer.
Dyanmic Measure | YTD Volume | PYTD Volume | Diff |
Thanks for anyones input
New To Power BI
Hi @Anonymous ,
Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.
Best regards
Amy
Hi @Anonymous ,
Currently, it is unsupported to create dynamic column based on slicer using a measure. As a workaround, you may enter into Query Editor, select on the column [Product], [Package] and [Customer] at the same time, right click to choose option "Unpivot columns".
You may rename the new resulted column Attribute with "SelectedColumn", click button "Close & Apply".
Then you may put the [SelectedColumn] which contains names of Product, Package and Customer into Slicer as filter options.
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please see this article. It exactly describes what you are trying to do. You will end up with an expression like this (copied from that link).
https://www.fourmoo.com/2017/11/21/power-bi-using-a-slicer-to-show-different-measures/
Selected Measure =
VAR MySelection =
SELECTEDVALUE ( ‘Measure Selection'[Measure Name], “Sales” )
RETURN
SWITCH (
TRUE (),
MySelection = “Sales”, [Sales],
MySelection = “Costs”, [Costs],
MySelection = “Margin”, [Margin],
[Sales]
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
In the example you sent me.
I would like to dynamically replace the Date column with Product or Package and leave the other values constant.
Where I am struggling is creating the measure.
All the examples I have found are like the one you sent me. Where someone write Sales= SUM(Sales).
I have a Measure called "Product". I just want to list all the products. So the SUM syntax doesnt work for me. I am trying to understand what Syntax I need to use to create the new Product Measure that will then allow me to write the expression.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |