Forum Discussion
Hide Measure column in Matrix that contains no value
hello,
- Forecast : is applicable to all Fiscal Quarter
- Shipped : is applicable to Current and Past Quarters only (Qtr_Sequence_No <= 0)
- Forecast Variant : is applicable to Current and Past Quarters (Qtr_Sequence_No <= 0)
- Scheduled Ship : is applicable to Current and may be Future Quarters (Qtr_Sequence >= 0 )
- Backlog : is appliable to Current and may be Future Quarters (Qtr_Sequence >= 0)
You forgot to either expand or go into the next level in the hierarchy. If there isn't a single field of the display column parameter, SELECTEDVALUE returns blank so none in the switch conditions is met.
7 Replies
- lbendlin
Super User
How would that look like in the UI?
You could create a super measure (ie a reference table that lists all the measures, similar to what Field Parameters do) and then return BLANK() as needed which would hide those "columns" - but only if ALL cells are blank for that column/measure.
- danextian
Super User
Field parameters work like pseudo-dimensions that let you switch between measures, but even when a measure has blank values, it will still appear as a separate column. Since your sample PBIX already includes a field parameter, use its field name column as the column header instead of treating it like a measure selector - just ensure to choose Show selected field rather than its values.
Then create this measure:
Display_Column_Value = SWITCH ( SELECTEDVALUE ( Display_column[Display_column Order] ), 0, [forecast qty], 1, [Shipped qty], 2, [variant], 3, [schedule ship], 4, [Backlog qty] )Please see the attached pbix.
- mbudiman
Helper III
hi Danextian,
The solution works 🙂
So I try to recreate new table matrix according to your advise :
1. Use the Field parameter as column header and set "Show Selected field"
2. I use the measure you had already created.
However, no value is display in the matrix. Do I miss any step ? Could you help me one more time to point out missing step. I've upload the pbix. The new matrix I created is in the "Test" tab. Thank you in advance for your help.
- danextian
Super User
You forgot to either expand or go into the next level in the hierarchy. If there isn't a single field of the display column parameter, SELECTEDVALUE returns blank so none in the switch conditions is met.
- mbudiman
Helper III
hi Royel, I saw a video on using "Calculation Group" to hide a Measure column conditionally. I need help for DAX statement to achieve my problem scenario above.