Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

DAX issue

I ran into the situation while trying to automate all the manual entry values in measures. I have created table in DB as mentioned below.

 

Table Name :Demo

ColumnValue
CompanyMicrosoft
IdSO3F2
IdSO3F5
LocationBangalore  

 

Measure:

Measure:= CALCULATE(CONCATENATEX(FILTER(Demo,COUNTROWS(FILTER(Demo,EARLIER(Demo[Column])=Demo[Column]))),Demo[Value],","), FILTER(Demo, Demo[Column]="Id"))  

Output: SO3F2,SO3F5

When I pass this measure in some other DAX, I am getting this ID as a single value but this is expected as a separate value. So the data will filter for both ID SO3F2 & SO3F5. Please help me here to separate those value while passing in other DAX function.

 

Example:   there is a Measure Balance where i am putting the code as is 

Balance:= CALCULATE(SUM(SUMMARY[Available]),FILTER(SUMMARY,SUMMARY[CODE] IN {"SO3F2","SO3F5"}),FILTER(FACILITY,FACILITY[FLAG]="Y"))

 

i want to replace these two codes with one measure. In future multiple ID may get added up to DEMO table so i dont want to create 2 diffrent measure and call.

 

Thanks in Advance.

1 Reply

  • Anonymous,

     

    Try the following:

     

    1. Create a relationship between the Demo and Summary tables:

     

     

    2. Create the measure below:

     

    Balance = CALCULATE ( SUM ( Summary[Available] ), Demo[Column] = "Id" )