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 folks,
Experienced programmer but DAX beginner here. I need to somehow define and manage a number of global constants in my Power BI workspace and would like your suggestions on best practices. This is what has been tried so far:
(1) My predecessor (after which I am cleaning up) simply created an entire table containing just one cell with the constant value. I really don't want to use this solution, as it is bad coding practice and clutters the model view in Power BI.
(2) My first solution was to create a single-row table for global constants, with one cell for each column containing one value corresponding to column name. THe problem here is that referencing the value has a clunky syntax, like this:
A fun question.
As a side thought, you can hide tables and fields by using the "hide in report view" option that you get when you right click on them in the model view.
Power BI shows a lot more redundancy that SQL Server and sometimes its hard to deal with your built in instincts. You could create a "technical" table and then add your measures as calculated columns. that would give you a way to view all your measures at once. You can use the "enter data" button on the home ribbon and just enter one dummy value to create the table, or you can use the "new table" button on the modeling ribbon and use the table literal syntax MyTable= {"x"}
I'm a personal Power Bi Trainer I learn something every time I answer a question
The Golden Rules for Power BI
Help when you know. Ask when you don't!
I was curious about your saying that you could not find a way to reference parameters created in the query editor.
I found a post that pointed out that you need to check "enable load" for them
Then you can reference them like this calculated column example:
Help when you know. Ask when you don't!
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 |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
57 | |
49 | |
44 | |
18 | |
18 |