Forum Discussion
Anonymous
1 year agoNot applicable
User selectable values from dim table
Hello, I am implementing a new feature on a report page which allows a user to select which list of values from dim_table01 will then be used to filter three fact tables. The goal here is for the us...
- Anonymous1 year ago
Hi Anonymous ,
I made a sample for you.
Measure = SWITCH( SELECTEDVALUE('dim_type'[type]), "sel_01", IF( VALUES( 'dim_table01'[col-01])=TRUE(),CALCULATE( SUM('fact_table01'[value]),USERELATIONSHIP(dim_table01[col-00],fact_table01[fact_c01])),BLANK()), "sel_02", IF( VALUES( 'dim_table01'[col-02])=TRUE(),CALCULATE( SUM('fact_table02'[value]),USERELATIONSHIP(dim_table01[col-00],fact_table02[fact_c01])),BLANK()), "sel_all", IF( VALUES( 'dim_table01'[col-all])=TRUE(),CALCULATE( SUM('fact_table03'[value]),USERELATIONSHIP(dim_table01[col-00],fact_table03[fact_c01])),BLANK()) )Best Regards,
Wearsky
Anonymous
1 year agoNot applicable
Hi Anonymous ,
I made a sample for you.
Measure = SWITCH(
SELECTEDVALUE('dim_type'[type]),
"sel_01",
IF( VALUES( 'dim_table01'[col-01])=TRUE(),CALCULATE( SUM('fact_table01'[value]),USERELATIONSHIP(dim_table01[col-00],fact_table01[fact_c01])),BLANK()),
"sel_02",
IF( VALUES( 'dim_table01'[col-02])=TRUE(),CALCULATE( SUM('fact_table02'[value]),USERELATIONSHIP(dim_table01[col-00],fact_table02[fact_c01])),BLANK()),
"sel_all",
IF( VALUES( 'dim_table01'[col-all])=TRUE(),CALCULATE( SUM('fact_table03'[value]),USERELATIONSHIP(dim_table01[col-00],fact_table03[fact_c01])),BLANK())
)
Best Regards,
Wearsky