The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have a table that is generated from a power BI dataset and returns a table as follows:
Organization[OpCo] | Clients[Client Code] |
Alabama | ABCINC |
Alabama | FASTTRA |
You'll see the line that reads:
TREATAS({"Alabama"}, 'Organization'[OpCo])
I would like "Alabama" to be a variable based on either:
The goal is that when the user changes the OpCo in cell A1 on the Dashboard tab, this table will update with the new information for the OpCo that was selected.
DEFINE VAR __DS0FilterTable = TREATAS({"Alabama"}, 'Organization'[OpCo]) VAR __DS0Core = SELECTCOLUMNS( KEEPFILTERS( FILTER( KEEPFILTERS( SUMMARIZECOLUMNS( 'Organization'[OpCo], 'Clients'[Client Code], __DS0FilterTable, "CountRowsFactPolicy", COUNTROWS('FactPolicy') ) ), OR( NOT(ISBLANK('Organization'[OpCo])), NOT(ISBLANK('Clients'[Client Code])) ) ) ), "'Organization'[OpCo]", 'Organization'[OpCo], "'Clients'[Client Code]", 'Clients'[Client Code] ) VAR __DS0BodyLimited = TOPN(500000, __DS0Core, 'Organization'[OpCo], 1, 'Clients'[Client Code], 1) EVALUATE __DS0BodyLimited ORDER BY 'Organization'[OpCo], 'Clients'[Client Code]
Hi @btardo01 ,
You need to have the values you want to select on a separate table and then you can change the code of the {Alabama} by VALUES(Table[Column]) this will allow to have a dynamic content on that treatas function.
But be carefull that this is for a calculation measure you cannot create an actual table on your model that is variable based on the input of the user on a report value.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsUser | Count |
---|---|
70 | |
64 | |
62 | |
49 | |
28 |
User | Count |
---|---|
117 | |
75 | |
61 | |
54 | |
42 |