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
Adiel
Regular Visitor

Multiple rows while adding to grid data from dimension

Hi Everyone,

 

Thank you for your time, Before getting into the problem directly I'll tell you the background of this.

 

I'm showing on a grid visual unique IDs from the fact table and a measure that checks if there is value in a specific column in the fact table for the selected id.

Measure:

 

 

 

SLA Status = 
   ISBLANK(SELECTEDVALUE('Alerts'[handledAt]))

 

 

 

the results before adding data from dimension:

Adiel_1-1646556470744.png


everything works fine until I add data from dimension.
then instead of showing the related data from the dimension for each ID, it generates a cartesian join with the data from the dimension.  
the results after adding data from the dimension:

Adiel_3-1646556566373.png

Adiel_4-1646556774940.png

 

I know there are alternative ways to calculate "SLA status", but my question is why it is even happening?

 

Thanks for your help

1 ACCEPTED SOLUTION

@Adiel 

You can see that once you add the column each id becomes repeated 6 times which is the number of unique values of the dim table column. The reson is that dim filters fact but not the opposite. Therfore the engine creates a cross join table which becomes the new filter context of the visual. 
what I meant is that if you want to show the corresponding Alert Status in the visual without creating problems thenyou have two options:

the first one as I mentioned you can create a new measure 

Alert Status = CALCULATE ( SELECTEDVALUE ( DimTable[AlertStats] ), CROSSFILTER ( DimTable[column], FacTable[column], Both)

then use the measure in your visual. 

2nd option is to create a calculated column in the FacTable using RELATED (DimTable[AlertStats]))

then use column in the visual.  

View solution in original post

7 REPLIES 7
tamerj1
Super User
Super User

Hi @Adiel 

When you add a column to a table visual it becomes part of the filter context and apparently this is what causes trouble in obtaining the desired results. In order to avoid that you need to add the Alert Status as a measure. You my use SELECTEDVALUE wraped with CLACULATE in in order to CROSSFILTER the relationship as "Both"

Why the filter contest is causing this problem?
Why does creating a BI-directional relationship should solve the problem?

@Adiel 

You can see that once you add the column each id becomes repeated 6 times which is the number of unique values of the dim table column. The reson is that dim filters fact but not the opposite. Therfore the engine creates a cross join table which becomes the new filter context of the visual. 
what I meant is that if you want to show the corresponding Alert Status in the visual without creating problems thenyou have two options:

the first one as I mentioned you can create a new measure 

Alert Status = CALCULATE ( SELECTEDVALUE ( DimTable[AlertStats] ), CROSSFILTER ( DimTable[column], FacTable[column], Both)

then use the measure in your visual. 

2nd option is to create a calculated column in the FacTable using RELATED (DimTable[AlertStats]))

then use column in the visual.  

Thank you for your clear explanation. 
Why there are no columns except "id" (alert id from fact) and "status" (from dim) it didn't happen ?
only when add the measure.

Adiel_0-1647113750136.png

 

Hi Adiel

Would you please clarify further on your question?

littlemojopuppy
Community Champion
Community Champion

Hi @Adiel I'm guessing that if you dropped a date/time field into the visual it's producing the history of each alert through the statuses.

What you're intending to show is the most recent status for each alert?

Hi @littlemojopuppy ,
It's not events\log table, so this isn't the situation.
each alert appears once in the table. 

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.