Forum Discussion

RavenQueen0311's avatar
RavenQueen0311
Frequent Visitor
4 years ago
Solved

Switch statement not working, Individual measures are

Good Morning,

 

I'm having an issue with a Switch Statement in one of my reports.  The Switch Statement is supposed to look at a column in the table and return the value of a specific measure based on the value of that column.  Most of the time, this works just fine, but when certain dates or other filters are applied, it simply returns a blank field instead of the measure value.  I've validated that the underlying measures calculate correctly if they are placed in a Card on their own, but not when part of the Switch Statement.
 

 

The Switch statement is as follows:

 

Current Accounts Switch = 
SWITCH (
    SELECTEDVALUE ( Accounts_Table[SubCategory] ),
    "Enrollments", FORMAT ( 'PATRON EXPANDED FINANCIAL DETAIL'[Current Enrollments], "#,##0" ),
    "Active 30", FORMAT ( 'PATRON EXPANDED FINANCIAL DETAIL'[Active 30 Current], "#,##0" ),
    "Active 60", FORMAT ( 'PATRON EXPANDED FINANCIAL DETAIL'[Active 60 Current], "#,##0" ),
    "Active 90", FORMAT ( 'PATRON EXPANDED FINANCIAL DETAIL'[Active 90 Current], "#,##0" )
)

 

I am unsure what may be wrong here.  Any help is appreciated.

  • Hello, I have solved this issue myself.  In my case, the issue was created by an incorrect relationship in my data model that caused certain peices of data to rely on unrelated tables in the model.  Once I cleared the relationship, this issue was fixed.

     

    Thank you to everyone for their time.

3 Replies