Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Im facing the following problem and Im not able to solve. If anyone could help me, I would appreciate it very much!
Power BI matrix:
Equipment | First | Last | Difference |
Truck |
|
| 54 |
Truck A | 1 | 2 | 1 |
Truck B | 20 | 23 | 3 |
Truck C | 50 | 55 | 5 |
Total |
|
| 54 |
First is a measure given by de minimum value of a column.
Last is a measure given bt th maximum value of the same column.
Difference is another measure given by Last - First.
I tried to use switch and isinscope, by I couldnt make the lines "Truck" and "Total" sum the results of the lines "Truck A", "Truck B" and "Truck C" in the column "Difference" (9).
Magic Measure =
SWITCH(
TRUE(),
ISINSCOPE('Table'[Equipment Type],[Difference],
ISINSCOPE('Table'[Equipment Name]),???????)
)
Solved! Go to Solution.
Hi,
Its more simple:
Diff =
var tbl = SUMMARIZE('table';'table'[Type];'table'[Name];"min"; MIN('table'[Value]);"max"; max('table'[Value]))
return
CALCULATE(SUMX(tbl;CALCULATE(max('table'[Value]))-CALCULATE(min('table'[Value]))))
Power BI file is here.
Please mark as solution if this works for you. Thanks!
Kind regards,
Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Hi,
Its more simple:
Diff =
var tbl = SUMMARIZE('table';'table'[Type];'table'[Name];"min"; MIN('table'[Value]);"max"; max('table'[Value]))
return
CALCULATE(SUMX(tbl;CALCULATE(max('table'[Value]))-CALCULATE(min('table'[Value]))))
Power BI file is here.
Please mark as solution if this works for you. Thanks!
Kind regards,
Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
That's it! Thank you!!
Hi,
Please see the solution on attached file.
If this post helps, then please consider Accepting it as the solution.
Thanks
Adi
Hi!
It's not possible to do like this, because both measures (First and Last) are calculated using values of the same column, like this:
Type | Name | Value |
Truck | Truck A | 1 |
Truck | Truck A | 2 |
Truck | Truck B | 20 |
Truck | Truck B | 21 |
Truck | Truck B | 22 |
Truck | Truck B | 23 |
Truck | Truck C | 50 |
Truck | Truck C | 51 |
Truck | Truck C | 52 |
Truck | Truck C | 53 |
Truck | Truck C | 54 |
Truck | Truck C | 55 |
First = MIN('table'[Value])
Last = MAX('tabel'[Value])
Difference = Last - First
So i cant calculate the Difference in the data table like you suggested.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
71 | |
37 | |
21 | |
19 | |
13 |
User | Count |
---|---|
125 | |
40 | |
32 | |
27 | |
24 |