Forum Discussion
Create a measure Based on Visual values
- 1 year ago
Hi chetan8080,
I have used sample data and implemented the solution in Power BI Desktop. Please have a look."Try this DAX Measure:
Unique In Visual =VAR CurrentValue = SELECTEDVALUE(Sheet1[Value])VAR VisibleRows =SUMMARIZE(ALLSELECTED(Sheet1),Sheet1[ID],Sheet1[Value])VAR CountVisible =COUNTROWS(FILTER(VisibleRows,[Value] = CurrentValue))RETURN IF(CountVisible = 1, 1, 0)I have included the PBIX file that I created using the provided sample data. Kindly review it and confirm whether it aligns with your expectations.I hope my suggestions provided valuable insights. If you have any further questions, don’t hesitate to ask in a follow-up message.
If this post helped, please mark it as "Accept as Solution" so others can benefit as well.Best regards,
Sahasra
Communtiy Support Team. - 1 year ago
Hi chetan8080,
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you providedNeed help uploading data?How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Thank you.
Hello SolomonovAnton , thank you for replying,
See below pictures where the ID is repeating but still DAX Returns me 1 instead of 0
The dax should give 1 only when the ID is unique in the visual, if it gets repeated it should give 0.
Thanks,
Chetan J
- v-sgandrathi1 year agoCommunity Support
Hi chetan8080,
I have used sample data and implemented the solution in Power BI Desktop. Please have a look."Try this DAX Measure:
Unique In Visual =VAR CurrentValue = SELECTEDVALUE(Sheet1[Value])VAR VisibleRows =SUMMARIZE(ALLSELECTED(Sheet1),Sheet1[ID],Sheet1[Value])VAR CountVisible =COUNTROWS(FILTER(VisibleRows,[Value] = CurrentValue))RETURN IF(CountVisible = 1, 1, 0)I have included the PBIX file that I created using the provided sample data. Kindly review it and confirm whether it aligns with your expectations.I hope my suggestions provided valuable insights. If you have any further questions, don’t hesitate to ask in a follow-up message.
If this post helped, please mark it as "Accept as Solution" so others can benefit as well.Best regards,
Sahasra
Communtiy Support Team.- chetan80801 year agoHelper II
Hi v-sgandrathi ,
thank you for your response.
I tried your solution but it does not work for big data, please see attached image,First 4 rows are giving the correct results, the following rows even after having same ID and different PO gives false.
The false expectation in this dax is as shown in this image below which is incorrectly showing true- v-sgandrathi1 year agoCommunity Support
Hi chetan8080,
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you providedNeed help uploading data?How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Thank you.