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
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

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
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

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

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