cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
elemesey
Frequent Visitor

Count Value Lookup

Good day everyone,

I'm a beginner to DAX and need assistance. I have a list of customers that have made sales, and I'd like to know the total number of customers who have not made sales during the specified time frame. 

elemesey_0-1694762257179.png



I'm also open to suggestions for the proper name for this subject 😅 When you view this post, I appreciate all of your help 😊

Thank you.

Test File - https://drive.google.com/file/d/1kbQsdWT47QYGqnHOemsU040vrYcETNM1/view?usp=drive_link 

1 ACCEPTED SOLUTION

Hi @elemesey ,

 

I suggest you to try code as below.

Count of Customer no sales =
VAR _COUNTBYREGION =
    SUMMARIZE (
        Sales,
        Sales[Region],
        "COUNTBYREGION",
            CALCULATE (
                DISTINCTCOUNT ( Allcustomer[Customer] ),
                ALLEXCEPT ( Allcustomer, Sales[Region] )
            )
    )
RETURN
    SUMX ( _COUNTBYREGION, [COUNTBYREGION] )
        - CALCULATE ( DISTINCTCOUNT ( Allcustomer[Customer] ) )

Result is as below.

vrzhoumsft_0-1695007646740.pngvrzhoumsft_1-1695007663537.png

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Ahmedx
Super User
Super User

write what result you want to see

Hi @elemesey ,

 

I suggest you to try code as below.

Count of Customer no sales =
VAR _COUNTBYREGION =
    SUMMARIZE (
        Sales,
        Sales[Region],
        "COUNTBYREGION",
            CALCULATE (
                DISTINCTCOUNT ( Allcustomer[Customer] ),
                ALLEXCEPT ( Allcustomer, Sales[Region] )
            )
    )
RETURN
    SUMX ( _COUNTBYREGION, [COUNTBYREGION] )
        - CALCULATE ( DISTINCTCOUNT ( Allcustomer[Customer] ) )

Result is as below.

vrzhoumsft_0-1695007646740.pngvrzhoumsft_1-1695007663537.png

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-rzhou-msft,

It works fantastic, thank you very much! 😊

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors