Forum Discussion
mrleijzer
6 years agoHelper I
USERELATIONSHIP not working correctly
Hello all, I have two tables, Calendar and Projecttakken. There's a main active relationship between Calendar[Date] and Projecttakken[Boekdatum]. There's also an inactive relationship between C...
mrleijzer
6 years agoHelper I
Back to the drawing board...
Measure= CALCULATE(DISTINCTCOUNT(Projecttakken[Boeknummer])
works fine, 1073 records, just like I expected.
Measure= CALCULATE(DISTINCTCOUNT(Projecttakken[Boeknummer]);Statussen[Statuscategorie]="Vervallen")
works fine also, getting and expecting 3 records
So when I add USERELATIONSHIP
Measure=
CALCULATE(DISTINCTCOUNT(Projecttakken[Boeknummer]);Statussen[Statuscategorie]="Vervallen";USERELATIONSHIP('Calendar'[Date];Projecttakken[Gewijzigd]))
It's blank again, so there must be a relationship problem, but where?
- v-lid-msft6 years agoCommunity Support
Hi mrleijzer ,
We can try to use the following measure to meet your requirement:
Measure = CALCULATE ( COUNT ( Projecttakken[Boeknummer] ); FILTER ( ALLSELECTED ( Projecttakken ); Projecttakken[Gewijzigd] IN FILTERS ( 'Calendar'[Date] ) && RELATED ( Statussen[Statuscategorie] ) = "Vervallen" ) )If it does not work, could you please describe the relationship between Projecttakken and Statussen tables simply if it does not contain any confidential information?
Best regards,- mrleijzer6 years agoHelper I
Thanks!
Using your formula PowerBI says that the column Statussen[Statuscategorie] either doesn't exit or doesn't have a relationship in de current context.
Below an image of the two tables and how they're related (both decimal number format).
- v-lid-msft6 years agoCommunity Support
Hi mrleijzer ,
Thank you for your additional information, could you please try to use the following measure?
Measure = CALCULATE ( COUNT ( Projecttakken[Boeknummer] ); FILTER ( ALLSELECTED ( Projecttakken ); Projecttakken[Gewijzigd] IN FILTERS ( 'Calendar'[Date] ) ); Statussen[Statuscategorie] = "Vervallen" )
Best regards,