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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

0

Using Two filter in distinctcount function DAX in Power BI

Hi, 

I trying to create the DAX to display the total  number of supplier with 1 invoice count and also below $1000 on spend.

 

I want to use two filters (1 invoice count and also below $1000 on spend) to find the total number of supplier.

 

How to add the two filter same DAX, please find the screenshot of the existing DAX, I have.

DAX.PNG

 

Thank You in advance!

Status: Delivered

Hi @Anonymous ,

 

May I know whether the column named ‘Number of invoice’ in your Table visual and the column called ‘Data[Document Invoice Number]’ are the same column in your Fields pane?

Please try this Measure.

 

Count Of Vendor Below spend of $1000 with One Invoice =

CALCULATE (

    DISTINCTCOUNT ( Data[Vendor] ),

    FILTER (

        Data,

        Data[Number of invoice] = 1

            && Data[Converted amount in USD] < 1000

    )

)

 

Then, the result should look like this.

vcazhengmsft_0-1645066753540.png

 

If I misunderstand your problem, please provide some sample data from your tables and tell me the relationships among them. If it is convenient for you, please provide a link of a sample pbix file containing your issue so I can find a solution for you. Thanks in advance!

 

Best Regards,

Community Support Team _ Caiyun

Comments
v-cazheng-msft
Community Support
Status changed to: Delivered

Hi @Anonymous ,

 

May I know whether the column named ‘Number of invoice’ in your Table visual and the column called ‘Data[Document Invoice Number]’ are the same column in your Fields pane?

Please try this Measure.

 

Count Of Vendor Below spend of $1000 with One Invoice =

CALCULATE (

    DISTINCTCOUNT ( Data[Vendor] ),

    FILTER (

        Data,

        Data[Number of invoice] = 1

            && Data[Converted amount in USD] < 1000

    )

)

 

Then, the result should look like this.

vcazhengmsft_0-1645066753540.png

 

If I misunderstand your problem, please provide some sample data from your tables and tell me the relationships among them. If it is convenient for you, please provide a link of a sample pbix file containing your issue so I can find a solution for you. Thanks in advance!

 

Best Regards,

Community Support Team _ Caiyun

Anonymous
Not applicable

Thanks you @v-cazheng-msft 

 

It's working from your formula. I add "&&" between two filters. Getting right numbers now.

v-cazheng-msft
Community Support

Hi @Anonymous ,

 

Thanks for your reply! That’s great!

 

As a supplement, If you have any problems on DAX in the future, please consider posting your issue in DAX Commands and Tips forums. There, many active users will engage in solving your problem and your DAX problems will be solved faster with their engagement.

 

And, here is the link of DAX Commands and Tips forum: https://community.powerbi.com/t5/DAX-Commands-and-Tips/bd-p/DAXCommands

 

Best Regards,

Community Support Team _ Caiyun