Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

Need help to write a measure

Hi,

 

Please refer the below link to download the sample report pbix

https://www.dropbox.com/s/2io37811qat95b8/sample%20report.pbix?dl=0

 

Current Behavior:

If i select any row in product_data table... table 2 table is displaying with the respective data of that selected quote and version.

 

followed below steps to achieve the requirement:

 

Created a copy from product table to achieve the requirement.

 

Steps:

 

1. Create new table based on product table and use new table to build visual.

Table formula:

 

Table = product_data

 

2.  measure to get selected value from new table, then compare table 2 row contents with above value to return tag.

 

Measure:

 

Tag =
IF (
MAX ( addon_data[version] ) IN ALLSELECTED ( 'Table'[version] )
&& MAX ( addon_data[quoteNo] ) IN ALLSELECTED ( 'Table'[quoteNo] ),
1,
0
)

 

3. Drag tag measure to table 2 visual level filter.

 

i want to add below condition to the measure:

 

If i select any row in product_data table... table 2 table is displaying with the respective data of that selected quote and version. Along with that, I also need condition so that the proposalId column value in table 2 to be replaced with proposalNewId column value (i.e. 12 ). fyi... proposalNewId column is in addon_data table.

4 Replies

  • Can you please clarify what your after? If your trying to actually modify the contents of a table based on a slicer condition this is not possible as any calculated  columns are calculated when the worksheet is opened or data is refreshed but BEFORE any slicer selections are made. 

     

    IF you just want to to display the value of your proposal new ID (I.e. 12) to be displayed in your visual then just drag it in and set the the calculation to any aggregate measure like MAX, MIN etc and rename.  If you want to conditionally display this alternate  value you would need to write a measure.

     

    Can you mock up what you want the desired output to be?  

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for reply. Appreciate it. 

       

       If  User selects the selected record in the product_data table then the expected behavior should be like below

      Attached  mockup is the desired output.   

       

      please let me know if  further information is needed. 

       

       

       

       If  User unselects the selected record in the product_data table then the expected behavior should be like below,  i.e.  proposalId column value in table 2   should be replaced with  1 .