Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
110 | |
96 | |
90 | |
81 | |
69 |
User | Count |
---|---|
157 | |
125 | |
116 | |
111 | |
95 |