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
mroomi
Helper II
Helper II

Add filter value into the report header

Hi,

I'm trying to use the date filter in to report the report header, for example I have created a report on the fiscal year 2013-2014 but once I change the fiscal year to 2-14-2015 it should refresh the report header instead of me or the user changing the report header or create a new report.

 

Thanks,

Roomi

2 ACCEPTED SOLUTIONS

@mroomi Try this another approach. Download custom visual called Long Text Viewer from here. Drop same field in this visual as your report filter. Format it so that it looks like your report header. Then whenever a value is selected in your filter visual will also be filtered.

View solution in original post

@mroomi, Example below  

 

Measure Defined a below:

 

Filtered Year = IF ( ISFILTERED(vw_Name[PSPStatus]), CONCATENATE("Document Count for the Fiscal Year ", (IF(HASONEVALUE(vw_Name[PSPStatus]), FIRSTNONBLANK(vw_Name[PSPStatus],"") ,""))), "Report Page is not Filtered by FY")

 

Table Data:

Table DataTable DataNo Values in FilterNo Values in Filter

FY Filtered Example.png

 

Noticed that Long Text Visual is unable to take Measure as an input ...

 

Hope this helps! 

View solution in original post

8 REPLIES 8
mroomi
Helper II
Helper II

Thanks both of you, really appreciate your help. 

This text visual really worked for my scenario.

sornavoor
Resolver I
Resolver I

@mroomi Create a DAX text measure using  HASONEVALUE & FIRSTNONBLANK & optionally [ISFILTERED or HASONEFILTER] and use this. 

 

For  example, please see Will Thompson's Create Impactful Reports With Power BI Desktop  MSDataSummit Video around  28:30 minute mark..  

 

 

 

 

 

Thanks,

I tried to create a simple one but I get the following error

 

Title = if (HASONEVALUE(vw_Name[PSPStatus]),vw_Name[PSPStatus])

 

Error = "A single value for column 'PSPStatus' in table 'vw_Name' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."

 

Actually what I'm trying to do is to when ever the user changes the value of the filter it reflects in the report headrer.

 

@mroomi Try this another approach. Download custom visual called Long Text Viewer from here. Drop same field in this visual as your report filter. Format it so that it looks like your report header. Then whenever a value is selected in your filter visual will also be filtered.

Hi ankitpatira,

Is there a way to use the long text visual with the teaxt header? Currently the long text visual is reading value from atextual field in database.

I'm trying to display the following text

 

"Document Count for the '2014-2015'" where 201-2015 value will be changed according to the filter. 

 

@mroomi, Example below  

 

Measure Defined a below:

 

Filtered Year = IF ( ISFILTERED(vw_Name[PSPStatus]), CONCATENATE("Document Count for the Fiscal Year ", (IF(HASONEVALUE(vw_Name[PSPStatus]), FIRSTNONBLANK(vw_Name[PSPStatus],"") ,""))), "Report Page is not Filtered by FY")

 

Table Data:

Table DataTable DataNo Values in FilterNo Values in Filter

FY Filtered Example.png

 

Noticed that Long Text Visual is unable to take Measure as an input ...

 

Hope this helps! 

It, worked perfectly, really appreciate all of you guys help.

Looks like you table vw_Name has multiple values  for  PSPStatus. 

 

I am assuming that you have this a column as a single select filter.  

 

You will have to consider situations for 

Whether it is filtered  or not  ..using ISFILTERED

      If is not filtered, then you will have to handle the case by having  an appropriate text - can be blank too .

      If it is indeed filtered, then you check for HASONEVALUE(vw_Name[PSPStatus])  

                  The True part is easy  just display the first value.  

                  For the False part you may need to have some logic to eithe take min or max or first etc...

 

Some thing like  below  and used the "Filtered Year" measure  in a card  visual and size it as needed 

 

Filtered Year  = IF ( ISFILTERED(vw_Name[PSPStatus]), CONCATENATE("Report Page is Filtered for FY for ", (IF(HASONEVALUE(vw_Name[PSPStatus]), FIRSTNONBLANK(vw_Name[PSPStatus],"") ,""))), "Report Page is not Filtered by FY")

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.