Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi Team,
I am working on creating Power BI reports which are embedded for clients in our companies' SaaS application. However, given the number of customers, we see requirements for different formulae to calculate the same metric.
We only want client to see numbers based on their own formula, so we get a reference key from the application to understand what formula the client uses and then write NESTED IF statements to arrive at the final formula. However, this leads to multiple iterations and deployments after updating the NESTED IF statement.
As a solution, we are thinking of creating a table which has the different "formulae" written in different rows (example below). So, if we have to add a new formula in the future, we can directly add it to the table and it will flow into the file.
Key | Formula |
1 | CALCULATE(COUNT('Employee Attributes'[User ID])) |
2 | CALCULATE(COUNT('Employee Attributes'[User ID]), FILTER('Employee Attributes', 'Employee Attributes'[Designation]<>Blank())) |
Now, we will use this as the reference. If a client has chosen the first formula in our settings then their dashboard only has the first row from the above table. We want to pick the value from the "Formula" column of the table and use it as the DAX expression (Example below)
Employee Count = FIRSTNONBLANK('Formulae'[Formula], False())
However, currently it returns the string as is from the "Formula" column.
Is there a way to use it as a formula?
Hi @Analytics1
Can you share sample data and sample output in table format or a sample pbix? Please remove any sensitive data in advance. We can better understand the problem and help you.
Best Regards,
Community Support Team _Yuliax
@Analytics1
Using a table to store different DAX formulas for clients is not a great approach, trying to dynamically interpret a DAX expression from a table poses challenges. DAX doesn't have a direct function to evaluate a string as a formula within a calculated column or measure.
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group