Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi, I am new to PowerBI,
I have a measure looks like : %Year = DIVIDE(SUM(Shipment[Profit]),SUM(Shipment[Revenue]))
And I have Score Table which is separated
ScoreID | %From | %To | Score |
1 | 0 | 5 | 1 |
2 | 5 | 15 | 2 |
3 | 15 | 25 | 3 |
4 | 25 | 45 | 4 |
5 | 45 | 60 | 5 |
6 | 60 | 100 | 6 |
I would like to make a measure called Score and show Score[Score] filtered by %From <= %Year < %To
ex) Score = Calculate(Score[Score], Filter(Score[%From] <= Shipment[%Year] < Score[%To]
Thank you
Solved! Go to Solution.
just add some code in the measure:
ScoreM = IFHASONEVALUE(TABLE[YOURCOLUMN]),Calculate(Values(Score[Score]), Filter(Score, Score[%From] >= [%Year] && Score[%To] < [%Year])) )
Hi, please try:
ScoreM = Calculate(Values(Score[Score]), Filter(Score, Score[%From] >= [%Year] && Score[%To] < [%Year]))
Hi, Thanks for the reply,
I tried with your suggestion,
I got error
Couldn't load the data for this visual
MdxScript(Model) (14,42) Calculation error in measure 'Shipments'[ScoreM]: A table of multiple values was supplied where a single value was expected.
Could you help me more?
If I hard code the value [%Year], it's working
ex) ScoreM = CALCULATE(VALUES(Score[Score]),FILTER(Score,Score[%From]<=4.5 && Score[%To]>=4.5))
just add some code in the measure:
ScoreM = IFHASONEVALUE(TABLE[YOURCOLUMN]),Calculate(Values(Score[Score]), Filter(Score, Score[%From] >= [%Year] && Score[%To] < [%Year])) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
117 | |
107 | |
70 | |
70 | |
43 |
User | Count |
---|---|
148 | |
106 | |
104 | |
89 | |
65 |