Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi Guys,
How to apply dax as measure on specific visual using javascriptapi?
I know that there is execute queries rest api to execute dax.
But how to apply dax on already existing visual?
Best,
Jacek
Solved! Go to Solution.
Hi @jaryszek ,
Thank you for posting in the Microsoft Fabric Community.
Currently, the Power BI JavaScript API does not support dynamically creating or applying new DAX measures to existing visuals within an embedded report. However, you can assign pre-defined measures to visuals using the API's setDataFields() method. For executing custom DAX queries, consider using the Execute Queries REST API, which allows running DAX queries against a dataset and retrieving results.
Please refer to the following documentation for more information:
Datasets - Execute Queries - REST API (Power BI Power BI REST APIs) | Microsoft Learn
For dynamic measure selection, it's advisable to predefine multiple measures in your dataset and enable users to choose among them as needed.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou
Thank you very much
Hi @jaryszek ,
Thank you for posting in the Microsoft Fabric Community.
Currently, the Power BI JavaScript API does not support dynamically creating or applying new DAX measures to existing visuals within an embedded report. However, you can assign pre-defined measures to visuals using the API's setDataFields() method. For executing custom DAX queries, consider using the Execute Queries REST API, which allows running DAX queries against a dataset and retrieving results.
Please refer to the following documentation for more information:
Datasets - Execute Queries - REST API (Power BI Power BI REST APIs) | Microsoft Learn
For dynamic measure selection, it's advisable to predefine multiple measures in your dataset and enable users to choose among them as needed.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |