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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
NilR
Post Patron
Post Patron

IN operator from dynamic table returns blank or error

Hi,

I am trying to do create my  var_TEMPTBL based on specific IDs that are in Var _CNSR_ID however both queries return nothing. what I am doing wrong?

 

 

 

VAR _CNSR_ID=
CALCULATETABLE(VALUES('0640 CONTRACT'[_ID]),FILTER('0640 CONTRACT',[ENRL_DATE]= Max_Date && '0640 CONTRACT'[GP]=_gp && [_ID] <> "0"))

VAR _TEMPTBL= SELECTCOLUMNS(
FILTER('0610 BI',([INC_DATE]>= Min_Date && [INC_DATE]<= Max_Date && [_ID] IN ( _ID)) && [GP]=_gp ),"GP", RELATED('DIM'[GP]),"_ID",_ID,"_BI",1)

RETURN
SUMX(_Temptbl,([__BI]

 

 

Thanks!

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@NilR , What Value of Min_date and Max-Date value ?

 

My approach is.

 1st  first return each variable. If table , I return sum or count of some column and step by step debug the formula

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @NilR,

What type of expression (e.g. measure or calculated column) are you working on? (the '_CNSR_ID' variable seems not to be invoked in your expressions)

If you mean calculated column, current power bi does not support creating dynamic calculated column based on filter selections. They are working on different levels and child level can't affect its parent.

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Notice: the data level of power bi.

Database(external) -> query table(query, custom function, query parameters) -> data model table(table, calculate column/table) -> data view with virtual tables(measure, visual, filter, slicer)

Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@NilR , What Value of Min_date and Max-Date value ?

 

My approach is.

 1st  first return each variable. If table , I return sum or count of some column and step by step debug the formula

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Thanks for reply! they are Variables from Calendar Table that I use in My filters.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.