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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.