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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Marcus352
Regular Visitor

Switch DAX

Hi all,

 

I've been attempting to address my problem for more than a week.
The following is a dax formula that I have.

Basically, when Course Level Name is selected, the "Var Overall RR" should provide me the data, whereas Overall RR CT should give me the data when Course Level Name is not selected. Unfortunately, the table disappears when I play with slicers.

Below is my dax. I can't seem to get it to operate. Could someone please assist.

 

Base Count =
Var SlicerRegional = SELECTEDVALUE(DIM_STUDENT_COHORT[REGIONAL_REMOTE_STATUS])
Var SlicerCommencing = SELECTEDVALUE(DIM_STUDENT_COHORT[STAGE_OF_STUDIES])
Var SlicerCitizenship = SELECTEDVALUE(DIM_STUDENT_COHORT[CITIZENSHIP_STATUS])
Var SlicerModeOfAttandance = SELECTEDVALUE(DIM_MODE_AND_TYPE_OF_ATTENDANCE[MODE_OF_ATTENDANCE])
Var SlicerTypeOfAttendance = SELECTEDVALUE(DIM_MODE_AND_TYPE_OF_ATTENDANCE[TYPE_OF_ATTENDANCE])
Var SlicerDisabilityStatus = SELECTEDVALUE(DIM_STUDENT_COHORT[DISABILITY_STATUS])
Var SlicerESB = SELECTEDVALUE(DIM_STUDENT_COHORT[ENGLISH_SPEAKING_BACKGROUND (groups)])
Var SlicerGender = SELECTEDVALUE(DIM_STUDENT_COHORT[GENDER])
Var SlicerIndigenousStatus = SELECTEDVALUE(DIM_STUDENT_COHORT[INDIGENOUS_STATUS])
Var SlicerMAC = SELECTEDVALUE(DIM_STUDENT_COHORT[MATURE_AGE_CATEGORY])
Var SlicerSES = SELECTEDVALUE(DIM_STUDENT_COHORT[SOCIO_ECONOMIC_STATUS])
Var SlicerCourseLevel = SELECTEDVALUE(DIM_COURSE_LEVEL[COURSE_LEVEL_NAME])
Var SlicerBFOE = SELECTEDVALUE(DIM_BROAD_FIELD_OF_EDUCATION[BROAD_FIELD_OF_EDUCATION_DESCRIPTION])

Var Overall_RR = CALCULATE(SUM(TXN_FACT_GOVERNMENT_BENCHMARK[Completion_COUNT]),DIM_STUDENT_COHORT[REGIONAL_REMOTE_STATUS] = "Total", DIM_STUDENT_COHORT[STAGE_OF_STUDIES] = "Total")

Var Overall_RR_CT = CALCULATE(SUM(TXN_FACT_GOVERNMENT_BENCHMARK[COMPLETION_COUNT]),DIM_STUDENT_COHORT[REGIONAL_REMOTE_STATUS] = "Total", DIM_STUDENT_COHORT[STAGE_OF_STUDIES] = "Total", DIM_JUNK_BENCHMARK_ANALYSIS[COLUMN_LEVEL_SUB_TOTAL] = "Sub-Total")

Return
SWITCH(TRUE(),
SlicerRegional = BLANK()
&& SlicerCommencing = BLANK()
&& SlicerCitizenship <> BLANK()
|| SlicerModeOfAttandance <> BLANK()
|| SlicerTypeOfAttendance <> BLANK()
|| SlicerDisabilityStatus <> BLANK()
|| SlicerESB <> BLANK()
|| SlicerGender <> BLANK()
|| SlicerIndigenousStatus <> BLANK()
|| SlicerMAC <> BLANK()
|| SlicerSES <> BLANK(),
Overall_RR,

SlicerCitizenship <> BLANK()
|| SlicerModeOfAttandance <> BLANK()
|| SlicerTypeOfAttendance <> BLANK()
|| SlicerDisabilityStatus <> BLANK()
|| SlicerESB <> BLANK()
|| SlicerGender <> BLANK()
|| SlicerIndigenousStatus <> BLANK()
|| SlicerMAC <> BLANK()
|| SlicerSES <> BLANK()
|| SlicerBFOE <> BLANK(),
Overall_RR_CT)

Thanks in advance

2 ACCEPTED SOLUTIONS
v-luwang-msft
Community Support
Community Support

Hi @Marcus352 ,

Please provide sanitized sample data that fully covers your issue.


Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

 

 

Best Regards

Lucien

 

View solution in original post

Marcus352
Regular Visitor

Hi Lucien,

 

Thanks so much. I figured it out, and I'll explain how I did it in my next post. I appreciate your support.

Cheers

View solution in original post

2 REPLIES 2
Marcus352
Regular Visitor

Hi Lucien,

 

Thanks so much. I figured it out, and I'll explain how I did it in my next post. I appreciate your support.

Cheers

v-luwang-msft
Community Support
Community Support

Hi @Marcus352 ,

Please provide sanitized sample data that fully covers your issue.


Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

 

 

Best Regards

Lucien

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.