Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Dellis81
Continued Contributor
Continued Contributor

Year parameter wants to be treated as text

Hello

 

As I attempt to understand paginated reporting - came across a weird instance of where the drop down selection for year is preceeded by a 1|.

Dellis81_0-1690990341288.png

 

I have verified in the source pbix file, the "Year" data column is treated as a whole number.

Below is the dax query (as found in the hidden datasets) for this parameter

EVALUATE SELECTCOLUMNS (ADDCOLUMNS (SUMMARIZECOLUMNS (ROLLUPADDISSUBTOTAL ('CALENDAR'[Year], "h0")), "ParameterLevel", if ([h0], 0, 1)), "ParameterCaption", SWITCH([ParameterLevel], 1, 'CALENDAR'[Year], "All"), "ParameterValue", [ParameterLevel] & "|" & 'CALENDAR'[Year], "ParameterLevel", [ParameterLevel], "'CALENDAR'[Year]", 'CALENDAR'[Year]) order by 'CALENDAR'[Year], [ParameterLevel]

 

As you can see, a component of this query contains "ParameterValue", [ParameterLevel] & "|" & 'CALENDAR'[Year].  This is probably the cause - but I have no clue what it means or purpose.   I have tried to delete segments of the query - only resulting in errors.

 

I do have a second pbix model with a connected rdl file - using Year from the calendar table - that is working correctly.  So, I know my process is correct.

 

Thank you!

2 REPLIES 2
d_gosbell
Super User
Super User

What this probably means is that someone has been into the parameter properties and in the Available Values the Label field has been set to the "ParameterValue" column. In the autogenerated parameters this should be set to the "ParameterCaption" column

d_gosbell_0-1691015136538.png

Each parameter in an RDL report has 2 properties, the Value which is passed in to the query and the caption which is what the user sees. This lets you do things like show the user a ProductName, but pass a ProductID to your query. This is not as useful in DAX based queries, but is often used in SQL based reports.

Dellis81
Continued Contributor
Continued Contributor

Thank you for your response 🙂

 

Here are the parameter settings the system auto created.   In my testing, I have deleted both the query and underlying parameter.   Report runs successfully.   Then I put the parameter back in, with auto parameter creation with same error result.

Dellis81_1-1691071302059.png

 

I do have auto updates turned on, and appears I have the most recent version.

thanks!

 

Dellis81_0-1691070995332.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.