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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

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

@Anonymous 

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 @Anonymous 

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"

Anonymous
Not applicable

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

@Anonymous 

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.  

Anonymous
Not applicable

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 @Anonymous 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?

Anonymous
Not applicable

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.