Forum Discussion

sivarajan21's avatar
sivarajan21
Icon for Post Prodigy rankPost Prodigy
2 years ago
Solved

Field Parameter button selection shows nothing in visual

Hi,

 

I have 2 field parameters that filters a visual like below:

The one field parameter acts as a main and other acts as sub.

Main will have only 2 buttons one for target and another for budget.

But sub will have 3 buttons such as Carbon, Units and Cost.

 

Their relationships are as below:

 

Now the issue is, when i press the carbon button, it is not displaying any values in the visual as below:

 

The Actual measure(Show values) that holds this carbon measure as shown below is:

 

But Actual Units and Actual Cost are showing values as below:

Actual Units:

 

Actual Cost

Please help me resolve this

 

PFA file here Portfolio 6 latest (2) - Copy.pbix

 

Please let me know if you need further info!

 

Thanks in advance!

marcorusso amitchandak Ahmedx Greg_Deckler Anonymous 

  • I see the problem.

    You're slicing by the field "Category Main" {budget, target}, but Carbon in the Parameter tables have no "category main".

    Thus, you're filtering "carbon" out.

    You won't even see "carbon' in [actual], because  "Category Main" filters your "Parameter 2" table.

     

    If you're going to slice by "category main', you can't leave that field empty in your parameter tables for "carbon".

     

    It's hard for me to offer a fix because the logic is a little hard to follow, but this is the problem.

     

6 Replies

  • rbriga's avatar
    rbriga
    Icon for Impactful Individual rankImpactful Individual

    Selecting the value of a field parameter may require something other than SELECTEDVALUE().

    Following this SQLBI article , try this pattern:

     

    1	VAR __SelectedValue =
    2	    SELECTCOLUMNS (
    3	        SUMMARIZE ( Parameter, Parameter[Parameter], Parameter[Parameter Fields] ),
    4	        "Row",Parameter[Parameter]
    5	    )
    6	RETURN IF ( COUNTROWS ( __SelectedValue ), __SelectedValue )

     

      

    This will replace your SELECTEDPARAMETER variable.

  • rbriga's avatar
    rbriga
    Icon for Impactful Individual rankImpactful Individual
    1. Can you share your measure [Carbon tCO2e] (and any measure it refferences, if any)?
    2. In the same chart, what happens if you replace the parameter with the measure [Carbon tCO2e] itself?

    I can't download the .pbix file because of my company's policy, so I'll need more info.

    • sivarajan21's avatar
      sivarajan21
      Icon for Post Prodigy rankPost Prodigy

      Hi rbriga ,

       

      Thanks for your quick response!

      Below is the carbon measure used

      Carbon tCO2e = SUMX(DataInvoice,DataInvoice[Units]*DataInvoice[Factor])/1000
       
      Factor in turn is a calculated column as below:
      Factor = calculate(max(Factor[Value]),FILTER(Factor, Factor[StartDate] <= DataInvoice[Date] && Factor[EndDate] >= DataInvoice[Date]),Factor[DBName - Utility]=RELATED(Points[DBName-Utility]))
       
      Relationships between calendar and factor is:

      Is there any issue with relationship here as they are related tables?

       

      with regards to second point, If i drag the carbon  measure to replace the parameter, it will show carbon but Units  & cost will not be displayed.
      End goal is to use the parameter to make it dynamic
      My confusion is,Actual Units and Actual Cost are showing values in chart visual but carbon only is not showing up: 
      Below is the field parameter table for your reference:

       

      Please let me know if you need further info!

      Thanks in advance!
  • rbriga's avatar
    rbriga
    Icon for Impactful Individual rankImpactful Individual

    I see the problem.

    You're slicing by the field "Category Main" {budget, target}, but Carbon in the Parameter tables have no "category main".

    Thus, you're filtering "carbon" out.

    You won't even see "carbon' in [actual], because  "Category Main" filters your "Parameter 2" table.

     

    If you're going to slice by "category main', you can't leave that field empty in your parameter tables for "carbon".

     

    It's hard for me to offer a fix because the logic is a little hard to follow, but this is the problem.

     

    • sivarajan21's avatar
      sivarajan21
      Icon for Post Prodigy rankPost Prodigy

      Hi rbriga ,

      Thanks fo your hint!

      I have found a solution for this and close this query by accepting your hint as solution