Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Joe_Reed
Frequent Visitor

Question about configuring multiple slicers and multiple DAX Switch statements

To all;

 

 I have a real world use case where I'm asked to take multiple slicers, set up as toggles, i.e.

 - all data is numeric, could be expressed as text for display  (not actual DAX code)

slicers:

Average/Total    "Average" = DIVIDE(<data> ,SUM(weeks))   

                           "Total "= SUM(<data>)

 

Dollars/Units  "Dollars" = SUM(<data>)         

                       "Units"    = SUM(<data>)

 

 CPIU/ROI       "CPIU" = ( return - cost) / units

                        "ROI"  = ( Return - cost)

 

         The basic toggles work well, independently, but my use case needs them to 'nest' or 'cascade'

the slicer slections and related value measures, so that data ex. "Spend" could be filtered by *Both*

Dollars/Units and then Average/Total

           

  The data model is enormous, and I have little control over import of data not included in the original

model.

 

  Any advice, suggestions or reasonably effective magic spells would be deeply appreciated

        Thank You !

             Joe

3 REPLIES 3
lance_6
Helper II
Helper II

This is just me theorizing. You probably have a slicer table to select the correct measures:

 

| Slicer Measure | Slicer Value |

| Average/Total  | 1                 |

| Dollars/Units    | 2                 |

 

and then some measures that look something like:

 

 

AverageSlicer = 
IF(
 SELECTEDVALUE( 
  SlicerTable[Slicer Value] = 1 
  || ISBLANK(SELECTEDVALUE(SlicerTable[Slicer Value])
 ),
 [Average]
)

TotalSlicer = 
IF(
 SELECTEDVALUE( 
  SlicerTable[Slicer Value] = 2 
  || ISBLANK(SELECTEDVALUE(SlicerTable[Slicer Value])
 ),
 [Total]
)

 

 

I propose something like this:

| Objective Slicer | Slicer Measure | Slicer Value |

| Average/Total  | Average/Total  | 1                 |

| Dollars/Units    | Dollars/Units    | 2                 |

| Both                 | Average/Total  | 3                 |

| Both                 | Dollars/Units    | 3                 |

 

AverageSlicer = 
IF(
 SELECTEDVALUE( 
  SlicerTable[Slicer Value] = 1 
  || SlicerTable[Slicer Value] = 3 
  || ISBLANK(SELECTEDVALUE(SlicerTable[Slicer Value])
 ),
 [Average]
)

TotalSlicer = 
IF(
 SELECTEDVALUE( 
  SlicerTable[Slicer Value] = 1 
  || SlicerTable[Slicer Value] = 3 
  || ISBLANK(SELECTEDVALUE(SlicerTable[Slicer Value])
 ),
 [Total]
)

 

 

Joe_Reed
Frequent Visitor

these are some of the mesauses being toggled 

Examples:

------------------------------------

Toggle Dollars/Units

Base Dollars/Units =
IF (
ISCROSSFILTERED (DollarsUnits[DollarsUnits]),
SWITCH ( TRUE(),
 
VALUES(DollarsUnits[DollarsUnits])= "Dollars",Format('Promos'[SwitchBaseDollars],"$#,##"),
VALUES(DollarsUnits[DollarsUnits])= "Units",'Promos'[SwitchBaseUnits],
-------------------------------------------------------------
SwitchBaseDollars = DIVIDE(SUM(Promos[Base Dollars]),sum('Promos'[Promo Weeks]))
SwitchBaseUnits = DIVIDE(SUM(Promos[Base Units]),sum('Promos'[Promo Weeks]))
 

BLANK()),BLANK())
 
AlexisOlson
Super User
Super User

I'm not quite sure I understand the situation. How do you have your measures written so that they work independently but not combined?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors