Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I need to create a measure where it gives me 1 or 0 based on values in a matrix visual,
In the above picture the first two yellow highlighted values are unique in the matrix should have 1 as result rest others should get 0,
These values are not unique in the table backend, these get repeated in the table, The measure should ignore the table and just check values from the visual and give results.
Basically it should check rows in the visual and those rows which have unique ID should give 1 as result or else 0
Thank you in advance
Solved! Go to Solution.
Hi @chetan8080,
I have used sample data and implemented the solution in Power BI Desktop. Please have a look."
Try this DAX Measure:
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.
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 provided
Need 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
Hi @chetan8080,
I have used sample data and implemented the solution in Power BI Desktop. Please have a look."
Try this DAX Measure:
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.
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
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 provided
Need help uploading data?How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Thank you.
Hi @chetan8080,
I wanted to check if you had the opportunity to follow up on our previous conversation. If yes can you please provide the sample data so that we can provide you with the accurate and correct solution.
Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.
Thank you.
Hi @chetan8080,
I wanted to check if you had the opportunity to follow up on our previous conversation. If yes can you please provide the sample data so that we can provide you with the accurate and correct solution.
Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.
Thank you.
HI @chetan8080,
Can you please confirm whether you have resolved issue. If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. This will be helpful for other community members who have similar problems to solve it faster.
If we don’t hear back, we’ll go ahead and close this thread.Should you need further assistance in the future, we encourage you to reach out via the Microsoft Fabric Community Forum and create a new thread. We’ll be happy to help.
Thank you.
To achieve a measure that evaluates uniqueness *based on what's displayed in the matrix visual* (ignoring backend duplicates), you can use the DAX function ISINSCOPE along with COUNTROWS and FILTER on visible data using ALLSELECTED.
Here’s a measure that does this:
Unique In Visual = VAR CurrentValue = SELECTEDVALUE('YourTable'[ID]) VAR CountVisible = CALCULATE( COUNTROWS('YourTable'), FILTER( ALLSELECTED('YourTable'), 'YourTable'[ID] = CurrentValue ) ) RETURN IF(CountVisible = 1, 1, 0)
Add this measure to your matrix visual along with the ID and check the output. The measure will return 1 for unique IDs in the visual and 0 for repeated ones.
✔️ If my message helped solve your issue, please mark it as Resolved! 👍 If it was helpful, consider giving it a Kudos! |
User | Count |
---|---|
48 | |
31 | |
27 | |
26 | |
26 |
User | Count |
---|---|
60 | |
56 | |
36 | |
32 | |
28 |