Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello,
I have a shaft depth of value of: SM4_TASKS[FLT_DEPTHBENCH]. (Example values are 437.5m, 668.2m, 864.9m etc).
I have used the built in grouping function to bin the rows in the SM4_TASKS table into 10m bins. The name of this grouping is:
SM4_TASKS[FLT_DEPTHBENCH (10m bins)]
I would like to get the Max and Min SM4_TASKS'[FLT_DEPTHBENCH] value within each bin and calculate the delta difference between the two values. Eg: Inside the 460m-470m bin eg, I would expect to find 460.2m (Min) and 469.9m (Max).
I have achieved this successfully with the following:
Delta Depth (m) =
MAX('SM4_TASKS'[FLT_DEPTHBENCH]) - MIN('SM4_TASKS'[FLT_DEPTHBENCH])
The column total of the first table (unfiltered) correctly sums all of the delta depths in the column.
I have a secondary table below that is being filtered when I select a number of bins in the first table, I would like for the column total in the second table to sum the delta values of only the selected bins. In the image you can see in the second table (lower), the column total is 119.8 rather than 18.6 (9.8+9.8).
How do I adjust my measure so that the column total sums the selected bin delta values.
(I understand the error, that it is taking the MAX Value of the 780 bin and the MIN Value of the 670 bin, and calculating the difference of the two. However I just dont know how to fix!)
(I also have page level filters on which need to be respected).
Many thanks!
Rob
Solved! Go to Solution.
Hi @Rob123
I think this is what you're looking for:
Delta Depth (m) =
SUMX (
VALUES ( SM4_TASKS[FLT_DEPTHBENCH (bins)] ),
CALCULATE ( MAX ( SM4_TASKS[FLT_DEPTHBENCH] ) - MIN ( SM4_TASKS[FLT_DEPTHBENCH] ) )
)
This iterates over the distinct "bins", summing the delta per bin.
CALCULATE is required to convert the value of the bin column within the row context of VALUES ( ... ) into a filter (context transition).
Alternatively, you could leave your existing Delta Depth (m) measure as-is, and create a new measure referencing it:
Delta Depth (m) Summed per Bin =
SUMX (
VALUES ( SM4_TASKS[FLT_DEPTHBENCH (bins)] ),
[Delta Depth (m)]
)
In this case, CALCULATE is added automatically due to the measure reference.
Do either of these methods work for you?
Thank you OwenAuger. Legend! I used the first solution and this worked perfectly.
Hi @Rob123
I think this is what you're looking for:
Delta Depth (m) =
SUMX (
VALUES ( SM4_TASKS[FLT_DEPTHBENCH (bins)] ),
CALCULATE ( MAX ( SM4_TASKS[FLT_DEPTHBENCH] ) - MIN ( SM4_TASKS[FLT_DEPTHBENCH] ) )
)
This iterates over the distinct "bins", summing the delta per bin.
CALCULATE is required to convert the value of the bin column within the row context of VALUES ( ... ) into a filter (context transition).
Alternatively, you could leave your existing Delta Depth (m) measure as-is, and create a new measure referencing it:
Delta Depth (m) Summed per Bin =
SUMX (
VALUES ( SM4_TASKS[FLT_DEPTHBENCH (bins)] ),
[Delta Depth (m)]
)
In this case, CALCULATE is added automatically due to the measure reference.
Do either of these methods work for you?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 51 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 65 | |
| 39 | |
| 33 | |
| 23 |