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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Using USERELATIONSHIP several times inside the same measure

Hi,

 

I have a table with several dates columns, and I need to create a table with counts of them.

 

The basic ones, which are of the form CALCULATE( COUNTA( Table[Column] ), USERELATIONSHIP( Calendar[Date], Table[Date_Col] ) I already know how to get.

 

What I'd like to know is whether I can use USERELATIONSHIP several times in the same measure, and specify to which part of the measure that relationship has to be applied. Something like this:

 

Measure = CALCULATE( COUNTA( Table[Column1] ),

     FILTER( Table, Table[Date_1] <> BLANK() ) && USERELATIONSHIP( Calendar[Date], Table[Date_1] ),

     FILTER( Table, Table[Date_2] = BLANK() ) && USERELATIONSHIP( Calendar[Date], Table[Date_2] )

)

 

Thanks in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@martifapa , Not for the same table set.

But you can try as

Measure = CALCULATE( COUNTA( Table[Column1] ),
	FILTER( Table, Table[Date_1] <> BLANK() ) , USERELATIONSHIP( Calendar[Date], Table[Date_1] ))
) 
+ 
CALCULATE( COUNTA( Table[Column1] ),  FILTER( Table, Table[Date_2] = BLANK() ), USERELATIONSHIP( Calendar[Date], Table[Date_2] ))  

View solution in original post

2 REPLIES 2
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

If the above posts help, please kindly mark it as a answer to help others find it more quickly. thanks!

If not, please kindly elaborate more.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
amitchandak
Super User
Super User

@martifapa , Not for the same table set.

But you can try as

Measure = CALCULATE( COUNTA( Table[Column1] ),
	FILTER( Table, Table[Date_1] <> BLANK() ) , USERELATIONSHIP( Calendar[Date], Table[Date_1] ))
) 
+ 
CALCULATE( COUNTA( Table[Column1] ),  FILTER( Table, Table[Date_2] = BLANK() ), USERELATIONSHIP( Calendar[Date], Table[Date_2] ))  

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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