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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Arnold_Bry
Frequent Visitor

Power BI Q&A Visual is return strange results.

Hey guys,

I lost all my patient trying to fix bellow Q&A visual issue and need your help. 

 

I have a model in AAS that I can't modify directly, so i added measures for Q&A directly in report. 

In the model there are 2 tables that i use in this calculation: 

dim Calendar and fact employee:

Arnold_Bry_0-1715676821451.png

both tables are not connected each other with any active relationship. 

 

I have simple measure: 

Test =

VAR MaxDate = MAX ( 'CALENDAR MASTER'[Date] )

RETURN

CALCULATE(

    COUNTROWS(EMPLOYEE),

    EMPLOYEE[Effective Start Date] <= MaxDate,

    EMPLOYEE[Effective end date] >= MaxDate

)

 

When I call Measure through Q&A with Year filter on slicer i got same results as for KPI visual, and everything works as it should. 

Arnold_Bry_1-1715676950877.png

But whenever i put year filtering context into Q&A the results are going wild, e.g. 

Arnold_Bry_2-1715676986693.png

When we compare results gruped by year in both cases we can see totaly diffrent results, and also Total for Q&A visualization is wrong (based on measure logic it should be the same number as latest year):

Arnold_Bry_3-1715677010066.png

I check the year field and for sure the Year used for Q&A is the same field as used for grouping in table (it's working well with other fact tables that have active relationship). Also when I setup active relationship everything works fine, but every time when the filter context is setup in calculate (like in the example measure) the result is wrong. 

 

Have anyone idea what is causing the issue or how to fix it? I already lost all of my invention how to handle this problem.

3 REPLIES 3
johnbasha33
Solution Sage
Solution Sage

@Arnold_Bry 

  1. Filter Propagation: Q&A visualizations may not always propagate filters correctly, especially when using measures with complex filtering logic. Try simplifying your measure to see if it resolves the issue. For example, instead of using CALCULATE, you can try using simple FILTER expressions to filter the data.

  2. Context Transition: When using measures with CALCULATE, be mindful of how the filter context transitions between tables. In your case, since 'dim Calendar' and 'fact employee' are not connected, ensure that the filter context is applied correctly to both tables. You may need to use functions like CROSSFILTER or USERELATIONSHIP to establish the desired relationships between the tables within the measure.

  3. Date Filtering: Check if the date filtering applied by the Year slicer is affecting the results as expected. Sometimes, unexpected results can occur if there are conflicting or overlapping date filters in the report. Ensure that the date filter applied by the slicer aligns with the date fields used in your measure and visualization.

  4. Data Model: Since you mentioned that you cannot modify the data model directly, ensure that the relationships and data model structure are correctly configured to support your analysis. If necessary, you may need to work with the data model owner or administrator to make any required adjustments.

  5. Testing and Validation: Validate your measure logic and visualization results by comparing them against known data points or using simple test cases. This can help identify any inconsistencies or unexpected behavior in your calculations.


    Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

amitchandak
Super User
Super User

@Arnold_Bry , Do you have more than one column with the same name like a year? Check that out. If you have similar name Q&A might be picking up other one

I checked it carefully, all other colums are turned off for Q&A and also do not have the same name or synonym.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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