Forum Discussion
Retrieving viz DAX
I don't have an answer but I'm curious about your use case. What is the nature of your downstream model? Why must it depend on definitions of implicit measure configurations in a visual?
AlexisOlson I am building a data-model called model2, needs to query the viz1 in model1 which essentially becomes the datasource (let's call it src1Model2) for model2 that I am developing.
model2 has additional datasource (dim and fact) that needs to be data-modelled with src1Model2 table according to the business req/ stakeholder req downstream consumption (completely separate from downstrream consumption req of model1).
Model1 and subsequently viz1 is developed by different team and they are using implicit measure in viz1 which I can't influence and/control. So if they had originally used an explicit measure called tradeLoss = SUM(table[tradeLoss]) and changed to tradeLoss = MAX(table[tradeLoss]) , it would have not have made any difference to my query, cause on both days I am querying the viz like this and whether tradeLoss is SUM today, MAX tomorrow, MIN the day after, it does not put src1Model2 datasource at risk and the data I am querying would always be same as viz (i.e. src1Model2= viz1)
SUMMARIZE(dim1[field1],dim2[field2],"loss",[tradeLoss])
However, if implicit measure is used, the engine changes the background query based on the implicit calculation that gets changed, so if implict SUM is used today then engine generates
SUMMARIZE(dim1[field1],dim2[field2],"loss",calculate(sum(table[tradeLoss]
if implict MAX is used tomorrow then engine generates
SUMMARIZE(dim1[field1],dim2[field2],"loss",calculate(max(table[tradeLoss]
which means I need to manually check if the SUM from yesterday got changed to MAX today. IF yes, I need to manually account for that change in the SSAS query that updates/refreshes src1Model2 adatsource.
Think of this problem, as retrieving data from World Bank. Imagine WB is using data from different sources (fact and dim) to generate a view of GDP by country. I need to write a query to get daily GDP data to be utilized in model2. Now, WB provides web service through REST API that enables me to query daily GDP data. Example
https://search.worldbank.org/api/v2/wds?format=xml&count_exact=Algeria&fl=count,volnb,totvolnb,docna,repnme
But if WB had used Power BI to generate GDP view, I would have required the same DAX query that powers the GDP viz to give me the daily GDP data unless there is web service (API) currently provided by POWER BI that returns me the same data in viz1 in page1/tabl1 of report1 of dataset1 of workspace1 without requiring to know the back ground dax.
//pseudo API
https:app.powerbi.com/groups/{groupID}? format=xml&page=1&viz=table
- AlexisOlson2 years agoSuper User
I understand your requirement, just not why it's a requirement.
If you're using something as a data source, it shouldn't be changing unpredictably. Having MAX instead of SUM is an important change unless it's just iterating over a single row where the result is the same (in which case, it shouldn't make a difference downstream).
What are you doing downstream that having a dynamic data source like that seems like a good option?
- smpa012 years agoCommunity Champion
AlexisOlson I admit, it is not ideal. I usually work with data coming from proper database. But for this project, I have been tasked to get the data coming from viz1 as one of the data sources for all downsteam reporting for my portion.
So, before I turn this into a XY problem with the makers of model1 and start a storm, I am simply trying to figure out if there is a way (through web sevice or any other method) to sneak into the backdoor and get the DAX.