Dax error and conditional formatting for table values

Stacker

Board Regular
Joined
Jul 11, 2021
Messages
87
Office Version
  1. 365
Platform
  1. Windows
Hi so I have two tables that summarises the average of values in eaach table. The first has rows of faculty name, current question text and current question code.

The second table is current question code, current question text though the values are that for the university rather than broken down by faculty. However if I add the university to the table the matrix looks weird.

Anyhow I wrote a measure that shows what the difference between the two tables is:



Table difference = VAR facultysum = CALCULATE( AVERAGE(FACT_NSS_Combined[CRS_AGREE]), FILTER( DIM_FACULTY,VALUES(DIM_FACULTY[FACULTY_NAME])

// Add any other filters for DIM_FACULTY here ), FILTER( DIM_NSS_QUESTION, DIM_NSS_QUESTION[NSS_CURRENT_QUESTION_CODE] = VALUES(DIM_NSS_QUESTION[NSS_CURRENT_QUESTION_CODE]) && DIM_NSS_QUESTION[NSS_CURRENT_QUESTION_TEXT] = VALUES(DIM_NSS_QUESTION[NSS_CURRENT_QUESTION_TEXT]) // Add any other filters for DIM_NSS_QUESTION here ) )
VAR PortSum =
CALCULATE(
AVERAGE(FACT_NSS_Combined[CRS_AGREE]),
FILTER(
DIM_FACULTY,VALUES(DIM_FACULTY[FACULTY_NAME])
// Add any other filters for DIM_FACULTY here
),
FILTER(
DIM_NSS_QUESTION,
DIM_NSS_QUESTION[NSS_CURRENT_QUESTION_CODE] = VALUES(DIM_NSS_QUESTION[NSS_CURRENT_QUESTION_CODE]) &&
DIM_NSS_QUESTION[NSS_CURRENT_QUESTION_TEXT] = VALUES(DIM_NSS_QUESTION[NSS_CURRENT_QUESTION_TEXT])
// Add any other filters for DIM_NSS_QUESTION here
)
)

VAR result = facultysum - PortSum

RETURN result

When I try to apply conditional formatting to the values of the table I get an error like the image. How can I rectify my code to ensure the conditional formatting works?

Thanks in advance.
 

Attachments

  • unnamed (1).png
    unnamed (1).png
    33.1 KB · Views: 17

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top