Forum Discussion
BaldAccountant
3 years agoHelper III
Power pivot - Dynamic Measure
I am tyring to create a dynamic measure based on a post on another website in power pivot. There are two elements: -a table that creates dynamic choice of row values (i.e. parse out by insurance ty...
- 3 years ago
BaldAccountant
I've changed the data model relaying more on DAX. Please refer to attached sample file.= VAR FilterTable = FILTER ( Data, CONTAINS ( VALUES ( Groups[Group Values] ), Groups[Group Values], Data[FC] ) || CONTAINS ( VALUES ( Groups[Group Values] ), Groups[Group Values], Data[Specialty] ) ) RETURN SWITCH ( MIN ( Multi[MSR Number] ), 1, DIVIDE ( CALCULATE ( [Cases], FilterTable ), [Cases] ), 2, DIVIDE ( CALCULATE ( [Charges], FilterTable ), [Charges] ) )
tamerj1
3 years agoCommunity Champion
BaldAccountant
Please try using ALL instead of ALLSELECTED
Cases :=
DIVIDE ( [Cases], CALCULATE ( [Cases], ALL ( Data2 ) ), 0 )
The SWITCH measure can be simplified (just less dax) as follows
MeasureValue5 :=
SWITCH (
MIN ( Multi[Msr Number] ),
1, CALCULATE ( FORMAT ( [Current % Cases], "#,#0.0%;(#,#0.0%);-" ), Groups ),
2, CALCULATE ( FORMAT ( [Avg Charges], "#,#0;(#,#0):-" ), Groups ),
3, CALCULATE ( FORMAT ( [Cases], "#,#0;(#,#0;-" ), Groups ),
4, CALCULATE ( FORMAT ( [Current % of Charges], "#,#0.0%;(#,#0.0%);-" ), Groups ),
5,
CALCULATE (
FORMAT ( [Expense % Reimbursement], "#,#0.0%;(#,#0.0%);-" ),
Groups
)
)BaldAccountant
3 years agoHelper III
Sorry, I tried your solution using ALL instead ALLSELECTED, but it gave the same result, all 100%
- tamerj13 years agoCommunity Champion
Any possibility you can share a sample file?