Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
9 | |
6 |