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.
I'm struggling with an requirement and I don't really know if it can be done in Power BI.
Requirements: 1)DAX expressions will be stored in a column within a table imported in the data model of PBI.
2) Dinamically a Mesaure within Power BI should take the DAX expresion stored and apply it.
I attach a small example of what I´m trying to do.
Customer | Data |
CLIENT1 | 145 |
CLIENT1 | 54 |
CLIENT1 | 777 |
CLIENT1 | 12 |
CLIENT1 | 55 |
CLIENT1 | 888 |
CLIENT1 | 12 |
Customer | Expression |
CLIENT 1 | MAX(Data[Data]) |
For that, I'm creating a Measure that applies the expression using the CALCULATE function:
The calculate returns the stored DAX but do not applies the formula:
Is this possible with DAX? Which expression should I use?
Any help would be appreciated thanks.
Greetings from Spain.
Solved! Go to Solution.
Hi , @Fgcillian
According to your description, you want to put a DAX expression in a table and then use a function to call the field.
According to my research, this is currently not possible in Power BI, and there is currently no function in the DAX function that can call text text to run expressions.
For your stored "MAX(Data[Data])", stored in Power BI is just a normal string format, so whatever formula is used, a string literal is returned.
With Measure, what is stored is really just a formula, which is only calculated when it needs to be calculated. For your different needs, you can try to create multiple measures or use some conditional judgment functions to meet your different needs.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , @Fgcillian
According to your description, you want to put a DAX expression in a table and then use a function to call the field.
According to my research, this is currently not possible in Power BI, and there is currently no function in the DAX function that can call text text to run expressions.
For your stored "MAX(Data[Data])", stored in Power BI is just a normal string format, so whatever formula is used, a string literal is returned.
With Measure, what is stored is really just a formula, which is only calculated when it needs to be calculated. For your different needs, you can try to create multiple measures or use some conditional judgment functions to meet your different needs.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thanks Aniya for your feedback.
It's clear now.
Best regards,
Cillian
@Fgcillian , Try like
calculate(MAX(Data[Data]), all())
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 |
---|---|
42 | |
21 | |
21 | |
14 | |
14 |
User | Count |
---|---|
43 | |
39 | |
33 | |
18 | |
17 |