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
Vialle_Diego
Frequent Visitor

Selectedvalue and Userelationship in the table

The status "Em andamento" does not have "Data de conclusão". So I created an inactive relationship of the dcalendario with the column "Data de Solicitação" and now I am trying to force through the formula below the purchases with status "Em andamento" to appear according to the dcalendario filter, but it is not working. Where am I wrong?

Status da Compra = 
CALCULATE (
    SELECTEDVALUE(fBase[Status], "Em andamento"),
    USERELATIONSHIP ( fBase[Data da solicitação], dCalendario[Data])
)

Vialle_Diego_0-1665677847452.pngVialle_Diego_1-1665677868713.png

 

after selecting 2022 in the filter, purchases with status "In progress" are removed.

Vialle_Diego_2-1665677951251.png

 

@tamerj1  Do you have any idea where I'm going wrong?

4 REPLIES 4
tamerj1
Super User
Super User

@Vialle_Diego 

Hello friend 

Try to CROSSFILTER the other relationship to NONE

Hey friend, nice to talk to you again!
So I read the documentation about the crossfilter, but I don't think it's what I need.

I need the "Data de Solicitação" column to respect the dcalendar filter for the "Em andamento" filter.

 

@Vialle_Diego 

Sometimes USERELATIONSHIP doesn't work by itself. You need to have CROSSFILTER- NONE along with it to deactivate the activate relationship and then USERELATIONSHIP will activate the inactive relationship. 

I tried to do it as follows, first create a measure for the lines with status "Em andamento". In the sequence I created the measure to disable the relationship of the column "Data de conclusão" and the dCalendar. And finally I used Userrelationship to force the relationship of "Data de solicitação" and dCalendar. Did I do something wrong?
The Status column for "Em andamento" continues to obey the dCalendar filter (which is related to the Data de conclusão)

Contratações em Andamento = 
CALCULATE (
    DISTINCTCOUNT ( fBase[Índice] ),
    FILTER ( fBase, fBase[Status] = "Em andamento" )
)

 

STATUS EM ANDAMENTO = 
CALCULATE (
    [Contratações em Andamento],
    CROSSFILTER ( fBase[Data de conclusão], dCalendario[Data], NONE ),
    USERELATIONSHIP ( fBase[Data da solicitação], dCalendario[Data] )
)

 

 

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.

Top Solution Authors