cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nagarjunav Frequent Visitor
Frequent Visitor

Re: How to get Minimum price Supplier name?

@AlbertoFerrari@Ashish_Mathur

 

No, i got an error while calculating 2nd formula i.e. 

VAR Suppliers =
    CALCULATETABLE (
        ADDCOLUMNS (
            VALUES ( Trans[Supplier Name] ),
            "SuppliedQty", CALCULATE ( SUM ( Trans[Qty] ) )
        ),
        ALLEXCEPT ( Trans, Trans[Item Code] ),
        Trans[Supplier Price] = MinPrice
    )

 

It is not working,  showing the below error.

 

The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression.

 

Can you please recheck the solution in Power BI, I mean can you provide the solution screenshot.

 

And one thing i want to tell you, In my case supplier price( I mean one supplier price) will be same for all transactions for that item code

 

Eg: Supplier A supplied at $1 for the item code 1001 . We may have 1000 transactions with supplier A for the item code 1001, but        he will supply at $1 only.

      Supplier C supplied at $3 for the item code 1001. We may have 2000 transaction with supplier C for the item code 1001, but          he will supply at $3 only.

 

Thank You

Regards

Nagarjuna

Highlighted

Re: How to get Minimum price Supplier name?

You can download the test file here: https://www.dropbox.com/s/gz881qnwd3dedfa/CheapestSupplier.pbix?dl=0

 

Have fun with DAX!

Alberto Ferrari
http://www.sqlbi.com

Alberto Ferrari - SQLBI
Nagarjunav Frequent Visitor
Frequent Visitor

Re: How to get Minimum price Supplier name?

Thank you @AlbertoFerrari

 

I made a mistake that's  why i got an error, sorry for that.

 

Now its worked without error but i got blanks in some rows (Almost in 50% rows). Can you Please tell me what could be the reason?

 

Thank you

Regards

Nagarjuna

Re: How to get Minimum price Supplier name?

Without looking at the data? No way... Likely, there's a bug somewhere in the code, but I would need some test data to find it. If you can share some sample data where the errors spots, then I can take a look at it.

 


Have fun with DAX!

Alberto Ferrari
http://www.sqlbi.com

Alberto Ferrari - SQLBI
Nagarjunav Frequent Visitor
Frequent Visitor

Re: How to get Minimum price Supplier name?

Thank you @AlbertoFerrari

 

Now its working, I changed formula according to my requirements.

 

Now i am checking with my report which i have done it in excel. If i found any deviations i will get back to you with the sample data, otherwise i will accept it as a solution.

 

Once again thank you so much 

Regards 
Nagarjuna