Forum Discussion

mark_carlisle's avatar
mark_carlisle
Icon for Advocate IV rankAdvocate IV
8 years ago
Solved

Power BI PowerApps visual issue filtering a measure with a slicer

I currently have a Power BI report that has a PowerApps visual in it. The purpose of the report is to show agents there customer survey results, sometimes these surveys are about other agents involved in resolving the customer issue or more about the process, product or company and there is therefore a need to remove these from the agent and reassign to another agent or removed altogether.

 

The app built into the report displays some details on the survey and then allows the agent to dispute the survey if they feel it is not related to them. The idea being that it reduces the potential for typos and allows validation of data before it is written to a database allowing the process to be vastly simplified.

 

Currently it looks like this;

 

 

 

 

The PowerApps visual is highlighted by the red box. The Survey Number slicer is just a slicer visual in Power BI. Under the inTouch Call Comments heading the wording Please select a Survey Number to view comments, when a survey number is selected in the slicer the app displays specifics on the survey as show below;

 

 

 

This is acheived with a measure in Power BI

 

PowerAppsCommentText =
IF (
ISFILTERED ( Surveys[SurveyID] ),
FIRSTNONBLANK ( Surveys[CommentText], 1 ),
"Please select a Survey Number to view comments"
)

On the PowerApps side of things the Text property of the Label is;

 

First(PowerBIIntegration.Data).PowerAppsCommentText

 

That's the background out of the way.

 

I'm in the process of redesigning the report and associated apps and I want to make the wording Please select a Survey Number to view comments much clearer. Essentially I want to hide all the headings displaying an information icon and wording centrally. 

 

So easy right? Just pass a 1 (filtered) or 0 (unfiltered) to PowerApps and then have parts of the interface either visible or not based on that number. So in Power BI I have a measure;

 

PowerAppsFilter = 
IF ( ISFILTERED ( Surveys[SurveyID] ), 1, 0 )

And on the PowerApps side in the Visible property of the data and heading fields;

 

If(First(PowerBIIntegration.Data).PowerAppsFilter = 1, true, false)

And on the information icon and wording;

 

If(First(PowerBIIntegration.Data).PowerAppsFilter = 0, true, false)

However, what happens is that the measure always shows as 1 in PowerApps, regardless if the Survey ID is filtered in Power BI or not. This results in the headings and data fields always showing, screenshots follow with the PowerApps visual highlighted in red again.

 

 

 

 

 

Now its not a big deal I can leave the app the way it is and everything will work fine but I'm stubborn and want to know why what I am doing isn't working, especially given what I've done previously at least to me appears to be the same.

 

Any suggestions?

  • v-jiascu-msft's avatar
    v-jiascu-msft
    8 years ago

    Hi mark_carlisle,

     

    I don't know what you are going to achieve. But I found we should adjust the formula in PowerApps. I added a default value with a formula. So it would react to the selections in the Power BI. Please refer to the formula and the snapshot below.

    If(IsBlank(First(PowerBIIntegration.Data).PowerAppsFilter), false, true)

    Power-BI-Power-Apps-visual-issue-filtering-a-measure-with-a-slicer2Power-BI-Power-Apps-visual-issue-filtering-a-measure-with-a-slicer3

    Best Regards,
    Dale

4 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi mark_carlisle,

     

    Can you share the details on how you created the PowerApp visual? Please refer to the snapshot below. At least it worked. 

    Power_BI_Power_Apps_visual_issue_filtering_a_measure_with_a_slicer

     

    Best Regards,
    Dale

    • mark_carlisle's avatar
      mark_carlisle
      Icon for Advocate IV rankAdvocate IV

      I created an app in PowerApps and then within the Power BI report added the visual and selected Existing app option rather than the create app.

       

      I take it if you deselect everything in the filter false changes to true?

       

      Would you be able to describe what you have done and I will follow to recreate your success on my end.

      • v-jiascu-msft's avatar
        v-jiascu-msft
        Icon for Microsoft Employee rankMicrosoft Employee

        Hi mark_carlisle,

         

        I don't know what you are going to achieve. But I found we should adjust the formula in PowerApps. I added a default value with a formula. So it would react to the selections in the Power BI. Please refer to the formula and the snapshot below.

        If(IsBlank(First(PowerBIIntegration.Data).PowerAppsFilter), false, true)

        Power-BI-Power-Apps-visual-issue-filtering-a-measure-with-a-slicer2Power-BI-Power-Apps-visual-issue-filtering-a-measure-with-a-slicer3

        Best Regards,
        Dale