Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NicoData1
New Member

Identify by cart distinct value

Dear all,

 

This is my first ever post on a forum so if I don't respect a rule please forgive me 🙂 

 

MY issues is that I have a listing of supplier (identifiy by a unique code) that work with 4 business unit (let's call them Pole 1/2/3...)

What I'm trying to do is to identify how many supplier is working only with one business unit (pole 1 or 2 or 3) through the card 

 

For my ExCo when they select for example Business Unit "Pole 1" I'd like the cart to change accordingly to number of suppliers that only belongs to them

 

NicoData1_0-1641357718614.png

 

 

Sorry if I'm not clear I can send you more details on request !

 

Thanks and have a good day

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @NicoData1,

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It will help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

In addition, you can also take a look at the following measure formula if helps:

DC_PCount =
VAR dcSupplier =
    SELECTCOLUMNS (
        FILTER (
            SUMMARIZE (
                ALL ( Table ),
                Table[SupplierCode],
                "PoleCount", COUNTROWS ( VALUES ( Table[SupplierCode] ) )
            ),
            [PoleCount] = 1
        ),
        "SupplierCode", [SupplierCode]
    )
VAR currList =
    CALCULATETABLE ( VALUES ( Table[SupplierCode] ), ALLSELECTED ( Table ) )
RETURN
    COUNTROWS ( INTERSECT ( currList, dcSupplier ) )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
NicoData1
New Member

Hello @v-shex-msft 

 

thanks it worked !!!

 

have a great day 

v-shex-msft
Community Support
Community Support

Hi @NicoData1,

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It will help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

In addition, you can also take a look at the following measure formula if helps:

DC_PCount =
VAR dcSupplier =
    SELECTCOLUMNS (
        FILTER (
            SUMMARIZE (
                ALL ( Table ),
                Table[SupplierCode],
                "PoleCount", COUNTROWS ( VALUES ( Table[SupplierCode] ) )
            ),
            [PoleCount] = 1
        ),
        "SupplierCode", [SupplierCode]
    )
VAR currList =
    CALCULATETABLE ( VALUES ( Table[SupplierCode] ), ALLSELECTED ( Table ) )
RETURN
    COUNTROWS ( INTERSECT ( currList, dcSupplier ) )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
lbendlin
Super User
Super User

Is the data all coming from the same table or from multiple tables? Are these tables linked in a data model?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.