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.
I'm trying to generate a distribution graph based on test results, allowing filtering by underlying variables within the sum for each run. For instance, if I select variables x1 and x2, the distribution should reflect only those variables, not the entire set (x1 + x2 + x3 + x4 ... + xn).
The challenge lies in generating bins along the x-axis and counts along the y-axis to visualize the distribution of results per run. My current idea involves creating custom dynamic bins and utilizing TREATAS to reference a table with a series. However, I am unsure if this is the correct method. I would appreciate assistance in figuring out how to implement this.
Below are my current measures and tables in the solution that does not work,
Data table:
Variable | Run | Value |
x1 | r1 | y1 |
x1 | r2 | y2 |
x1 | ... | y3 |
x1 | r | y4 |
x2 | r1 | y5 |
x2 | r2 | y6 |
x2 | ... | y7 |
x2 | r | y8 |
...and so on |
Messured used in y-axis:
Test 1 =
//Creates a table that sum for each run
VAR _simTable = SUMMARIZE(Sim_result, Sim_result[Run], "Result", SUM(Sim_result[Value]))
//Steps used in the series table ex. 1000 = -3
VAR _roundValue = -3
//Get max & min value of t
VAR _maxRes = MAXX(_simTable, [Result])
VAR _minRes = MINX(_simTable, [Result])
//Number of bins
VAR _binsN = 100
//Bin size
VAR _midRes = _minRes + (_maxRes - _minRes) / 2
VAR _binSize = ROUNDDOWN((_maxRes - _midRes) / (_binsN / 2 - 1), _roundValue)
//Creates new table with bins
VAR _simBinTable = ADDCOLUMNS(_simTable, "Result bin", MROUND([Result], _binSize))
VAR _simBinColumn = SELECTCOLUMNS(_simBinTable, "Result bin", [Result bin])
RETURN
CALCULATE(
COUNTX(_simBinTable, [Result bin]),
TREATAS(
_simBinColumn,
'Simulation bins'[Value]
)
)
To generate table with bins for x-axis:
Simulation bins =
//Creates a table that sum for each run
VAR _simTable = SUMMARIZE(Sim_result, Sim_result[Run], "Result", SUM(Sim_result[Value]))
//Steps used in the series table
VAR _steps = 1000
VAR _roundvalue = -3
//Get max & min value of t
VAR _max = MAXX(_simTable, [Result])
VAR _min = MIN(Sim_result[Value])
VAR _generate = GENERATESERIES(
ROUNDDOWN(_min, _roundvalue),
ROUNDUP(_max, _roundvalue),
_steps
)
RETURN
_generate
Solved! Go to Solution.
My current idea involves creating custom dynamic bins
That's not something you can do in Power BI. You'd have to look at custom visuals like Deneb, or other BI tools like Tableau which has LOD features.
My current idea involves creating custom dynamic bins
That's not something you can do in Power BI. You'd have to look at custom visuals like Deneb, or other BI tools like Tableau which has LOD features.
I looked at examples from RADCAD.com (see links) and thought they might work in my situation. Thank you for the tip; I'll explore custom visuals more deeply. Thank you!
https://radacad.com/age-banding-in-power-bi-using-treatas-dax-function-relationship-based-on-between
https://radacad.com/dynamic-banding-or-grouping-in-power-bi-using-dax-measures-choose-the-count-of-b...
I guess you can argue about the meaning of "dynamic". In Power BI you can only use buckets that you have defined beforehand.
Thank you btw, got it to work with Deneb
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 |
---|---|
98 | |
96 | |
75 | |
71 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |