Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I would like to write a measure based on my other measure, my data sample is as follows:
Score table :
and a factor table:
Both tables are related to a key table:
I have a measure in my Score table which calculates the minimum across all 'key' , with my 'batch' on a slicer
The measure is a simple min function: MIN(Score[score])
I want to calculate the [rate]*[factor] only for minimum scores. Is there a way or formula to do this calculation? Please let me know.
@k123 If I understand correctly, you want to find out min for a batch from first table. For example: For Batch 123, the minimum is 1(b1). Using this minimum for the batch 123(b1). You want to calculate the rate * factor for b1 only for Batch 123.
@Anonymous yes thats right
Use the below calculation to find the columns which have the min value.
IsMinScore = VAR MinForBatch = CALCULATE(MIN('Score Table'[Score]),ALLEXCEPT('Score Table','Score Table'[Batch])) RETURN IF('Score Table'[Score]=MinForBatch,'Score Table'[Score],0)
I am finding the min for every batch using ALLEXCEPT. and then comparing them to the score table. If it is then you can calculate the product, if not then output 0.
@Anonymous thanks for quick response, however I am not able to calculate the product inside the IF statement, since my product consists of two columns: 'factor' and 'rate', I want to multiply both these columns based on my minimum score
@Anonymous , actually my measure MIN, calculates the minimum score across all keys and for the selected batch on the slicer; so once I get the min score for each keys in a batch, I want to multiply the rate corresponding that minimum score with the factor. I hope I was able to clarify. Thanks
You may use LOOKUPVALUE Function to add a calculated column first.
User | Count |
---|---|
63 | |
59 | |
56 | |
38 | |
29 |
User | Count |
---|---|
82 | |
62 | |
45 | |
41 | |
40 |