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 experts!
We have a basic matrix with columns, rows and values. I need to calculate the KPI of the attached screen. The formula to calculate it can be found in the image, but is :
MAX((Precio Medio - ABOVE(Precio Medio))*Segmentos GroupBy Antelación.
Thanks
Solved! Go to Solution.
hi, @Setroc
After my research, you could do these as below:
Add a index column for day type
Step2:
Use EARLIER Function to add a KPI column
KPI = (Table1[Precio Medio]-CALCULATE(SUM(Table1[Precio Medio]),FILTER(Table1,Table1[Index]=EARLIER(Table1[Index])+1 )))*Table1[Segmentos]
Step3:
You could create a calculate table or a measure to find Max KPI value
a) create a calculate table
Table = FILTER(Table1,Table1[KPI]=MAX('Table1'[KPI]))
b)create a calculate measure
MAX KPI = var _maxkpi= CALCULATE(MAX(Table1[KPI]),ALL(Table1[day type])) return IF(MAX(Table1[KPI])=_maxkpi,_maxkpi,BLANK())
Here is pbix, please try it.
https://www.dropbox.com/s/incp3spymf8q2ba/Matrix%20%20Values%20above%20rows.pbix?dl=0
Best Regards,
Lin
hi, @Setroc
After my research, you could do these as below:
Add a index column for day type
Step2:
Use EARLIER Function to add a KPI column
KPI = (Table1[Precio Medio]-CALCULATE(SUM(Table1[Precio Medio]),FILTER(Table1,Table1[Index]=EARLIER(Table1[Index])+1 )))*Table1[Segmentos]
Step3:
You could create a calculate table or a measure to find Max KPI value
a) create a calculate table
Table = FILTER(Table1,Table1[KPI]=MAX('Table1'[KPI]))
b)create a calculate measure
MAX KPI = var _maxkpi= CALCULATE(MAX(Table1[KPI]),ALL(Table1[day type])) return IF(MAX(Table1[KPI])=_maxkpi,_maxkpi,BLANK())
Here is pbix, please try it.
https://www.dropbox.com/s/incp3spymf8q2ba/Matrix%20%20Values%20above%20rows.pbix?dl=0
Best Regards,
Lin
@v-lili6-msft Thanks a lot!
But the problem is my row-data is like :
And i create the Master file to order de days field :
Finally, my model looks:
Your solution is finde in query view, but the data is not equal.
Thanks for ur help!
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 |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |