Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi everyone,
Here is my sample data.
The 3 sheets are my 3 tables where the "General Info" table has all Store Names and the other 2 tables have several Store Names which have 1-to-many relationship through column "Store".
I have:
Question 1:
Is there a way to COUNT DISTINCT the number of Stores and RETURN "0" in those 2 Cards if the selection made from the StoreName slicer does not exist in 'NDT' or 'Laboratory'?
Ex: If Z is selected from StoreName slicer, the Count result should return 0 instead of the default (Blank)
Question 2:
a. If T is selected from the StoreName slicer and Ultrasonic is selected from the NDT slicer, is it possible to have Power BI showed "No alternate Store can do Ultrasonic"
b. If H is selected from the StoreName slicer and STI is selected from the NDT slicer, it it possible to show:
Can anyone please show me how to tackle this? Thank you so much!
Solved! Go to Solution.
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
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @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
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHello @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!
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @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
Hi @MFelix & @v-juanli-msft , thank you for your help! MFelix's answer worked perfectly on my new version!!! Thanks again!!!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
124 | |
114 | |
73 | |
65 | |
46 |