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
sagarpsali
New Member

Page level or report level filter

Hi All, I am facing one issue. Year and state as my main driver/field/column, but when nothing is selected, in report, graphs showing some values, don't know which values it is taking.

 

I have to implement a scenario, if year and state is not selected, then none will show in to the report. And once selected year and then either state, it need to show graph/chart, related to those value.

 

How I can implement this? Can someone help me.

6 REPLIES 6
greggyb
Resident Rockstar
Resident Rockstar

Wrap all your base measures in the following:

// DAX
// Measure template
MyNewMeasure =
IF(
    HASONEVALUE( 'DimDate'[Year] ) 
        && HASONEVALUE( 'DimGeography'[State] )
    ,<your old measure definition here>
    ,BLANK()
)

You're checking for the existence of exactly one unique value for each of [Year] and [State]. When this is the case, you evaluate the regular measure expression. When there is more than one unique value for either or both of [Year] and [State], then it returns BLANK().

If you see below image, in that case I have to create a new column for everytime when I will create a some chart or graph and have to add that code, is that so? Year and State selection is either one or more. but my requirement is like, is nothing selected then, nothing will show on graph, all graph or charts should blank, so once year and state selected, it will start populating the value.

 

 

Capture.PNG

 

Yes, you will have to create explicit measure to be used in each visual.

Hi Greg,

 

thanks for replying, but i am not looking only one selection, I am looking atleast one selection. When I created a new column with given code, but when i m going to the report, value is not populating in that, it is remaining blank, even if i select year and any state.

 

@sagarpsali, I'm unclear on your requirement now. Do you want to enforce exactly 1 year and >=1 state?

Hi,
My requirements is like if at least year and one state should be selected then only it will show graph. So there are chances that user can select one year or more and same for state. But need here is, to show some graph, user has to select at least one year and one state. Now what is happening, even if there is nothing selected either year or state, graph/report considering all input and showing the result.
Here one more question to me, when report will load, either by default all values from year and state should preselected and then user can decide which to select. If u see the diagram which I uploaded, it has select all option is there for states, if user click that "Select All" states get deselected. And even though, graph showing value. So when nothing is selected from state or year , none will appear on report. As soon as user will select at least one year and state, it should refect in graph.
I hope u understand my question.

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.