Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Scenario:
Connected to a Live PowerBI dataset that I don't have access to edit.
Have several Narrative text blurbs that I want to display on various pages of a report, and I want them to be dynamic based on the month and year selected from a slicer.
I created a measure which works, and updates when the user changes the slicer month/year.
SelectedPersonalSupportText =
VAR textTable =
DATATABLE(
"Year", INTEGER,
"Month Num", INTEGER,
"Textstring1", STRING,
"TextString2", STRING,
{
{2023, 3, "Long text string1", "Long Text string2" },
{ 2023, 2, "long text string1 2", "Long Text string2 2"}
}
)
VAR maxYear = YEAR([Max Date ALLSELECTED])
VAR maxMonth = MONTH([Max Date ALLSELECTED])
VAR filteredTable =
FILTER(textTable, [Month Num] = maxMonth && [Year] = maxYear)
RETURN
IF(
COUNTROWS(
FILTER(
textTable,
[Month Num] = maxMonth && [Year] = maxYear
)
) = 1 ,
MINX(filteredTable, [Textstring1]
),
"No analysis text available"
)
What I would like to do is break the filtered DATATABLE() out into a seperate measure for ease of maintenance. So that my measure to capture the text and get the value for each text box is a something like this.
Personal Support Text =
VAR temptextTable =
DATATABLE(
"Year", INTEGER,
"Month Num", INTEGER,
"Textstring", STRING,
{
{2023, 3, "Personal Support slipped $1.316 million (-3.7%) for a total of $33.954 million. That too was the third best on record following 2021 and 2022. However, we are down $7 million on the Fiscal Year to date....." },
{ 2023, 2, "Someother text that we can replace with"}
}
)
VAR maxYear = YEAR([Max Date ALLSELECTED])
VAR maxMonth = MONTH([Max Date ALLSELECTED])
VAR filtTable = FILTER(temptextTable, [Month Num] = maxMonth && [Year] = maxYear)
RETURN
filtTable
SelectedPersonalSupportText TEST =
VAR _table = [Personal Support Text]
RETURN
IF(
COUNTROWS(_table) = 1 ,
MINX([_table], [Textstring]
),
"No analysis text available"
)
If I copy the [Personal Support Text] measure into DAX Studio gives me the one row table as expected from the results, but trying to use this combo in the actual report results in a syntax/semantic error.
What gives? Thanks!
Solved! Go to Solution.
@FleetyBob Unfortunately you cannot return a table for a measure. Measures only support returning scalar values. You could use TOCSV as the return for your measure and then use this FROMCSV but it may be more hassle than its worth: FROMCSV - Microsoft Power BI Community
@FleetyBob Unfortunately you cannot return a table for a measure. Measures only support returning scalar values. You could use TOCSV as the return for your measure and then use this FROMCSV but it may be more hassle than its worth: FROMCSV - Microsoft Power BI Community
Thank you Greg for the response. While I knew you couldn't return a table through a measure to a visual I guess I was optimistacally incorrect that I could use a meaure as a Global variable that could be passed to several other measures. Back to the drawing board. I will look into the TOCSV/FROMCSV as a possible solution.
Cheers!
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 49 | |
| 40 | |
| 32 | |
| 14 | |
| 13 |
| User | Count |
|---|---|
| 87 | |
| 72 | |
| 37 | |
| 28 | |
| 26 |