Forum Discussion
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
- Seward12533
Solution Sage
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?
- AnonymousNot 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 .
- v-frfei-msft
Community Support
Hi Anonymous,
We can create a measure like this to meet your requirement.
Measure 2 = IF(ISFILTERED(product_data[category]),MAX(addon_data[proposalId]),MAX(addon_data[proposalNewId]))
For more details, please check the pbix as attached.
https://www.dropbox.com/s/t2t42p4sb7zz1ep/sample%20report%20%281%29.pbix?dl=0
Regards,
Frank