Forum Discussion
PBCIT
6 years agoFrequent Visitor
Using DAX to filter
Ok so I feel like I am missing something. I have a table that I use to get 3 or four other tables on the same axis in visuals (column charts, etc.). The table only has 2 columns and looks like this: ...
Anonymous
6 years agoNot applicable
// Assuming that Weeks table is disconnected.
// Create an auxiliary measure
// that will return for each Week #
// 1 if it should be shown and
// 0/BLANK if it shouldn't. Then, filter
// the visual by this measure's value
// = 1.
[Show Week #] =
var __maxNumOfWeeksVisible =
MAX( Program[# Weeks] )
var __result =
SELECTEDVALUE(
// this must start with 1
// and go up continuously
// up to the number of weeks
// in the table
Weeks[ID],
// this in case many weeks visible
1000
) <= __maxNumOfWeeksVisible
return
1 * __result
// Bear in mind that if many people are
// selected, then the number of weeks
// visible will be the maximum number
// of weeks among all the people and
// their programs.