Forum Discussion
Count Distinct from different tables + Find matching values
- 7 years ago
Hi trdoan,
Create the following measures:
Distintc Count Laboratory = IF ( DISTINCTCOUNT ( NDT[Store] ) = BLANK (); 0; DISTINCTCOUNT ( Laboratory[Store] ) ) + 0 Distintc Count NDT = IF ( DISTINCTCOUNT ( Laboratory[Store] ) = BLANK (); 0; DISTINCTCOUNT ( NDT[Store] ) ) + 0 NDT Alternatives Count = IF ( CALCULATE ( COUNT ( NDT[NDT] ); ALLSELECTED ( NDT[NDT] ) ) <> 1; DISTINCTCOUNT ( NDT[Store] ) ) NDT No alternatives = IF ( CALCULATE ( COUNT ( NDT[NDT] ); ALLSELECTED ( NDT[NDT] ) ) = 1; "No alternate Store can do : " & CONCATENATEX ( NDT; SELECTEDVALUE ( NDT[NDT] ); "," ); "Alternative Stores: " & CONCATENATEX ( NDT; NDT[Store]; "," ) )Check PBIX file attach.
Regards,
MFelix
Hello MFelix many thanks to your help! However, I noticed a few things which I've noted on the file here.
My Power BI version at work isn't up-to-date so I couldn't open your file, therefore I don't know if there're many differences in the problems I found compared to your file.
Please advise! Thank you sooo much!
I can try and make a file in your version.
Regards,
MFelix
- v-juanli-msft7 years agoCommunity Support
Hi trdoan
I believe MFelix's solution may help you.
I would suggest you to download the lastest version of Power BI which updates with more new features and fixes many issues occured in previous version.
Also it is backwords compatible. so don't worry about previous pbix files, you can use the lastest version to open and manage these.
Best Regards
Maggie
- trdoan7 years agoHelper III
Hi MFelix & v-juanli-msft , thank you for your help! MFelix's answer worked perfectly on my new version!!! Thanks again!!!