Forum Discussion
Slider problems
- 1 year ago
Hi RichardLinderma,
Please check the below pbix file by using sample data by switching to dropdown in the visual.
If this post helps, then please consider Accept it as a solution to help the other members find it more quickly.
Thank you.
Calculated tables and columns are not aware of slicer selections, so even though you can reference a measure inside them, its value won't change based on slicer input. In your case, the value of the MaxValue variable will always return the actual max of 'Future_Predicted'[Number_Of_Days_Slider], regardless of what is selected in the slicer. The calculated table must already contain all possible rows for every potential selection. For example, if account code 001 has a max value of 70, the table should include a column identifying that account and another column with rows from 1 to 70.
Sample calc table
AccountDayTable =
VAR BaseTable =
DATATABLE (
"AccountCode", STRING,
"MaxDay", INTEGER,
{
{ "001", 70 },
{ "002", 50 }
}
)
VAR _Expanded =
GENERATE (
BaseTable,
ADDCOLUMNS ( GENERATESERIES ( 1, [MaxDay], 1 ), "Day", [Value] )
)
RETURN
SELECTCOLUMNS ( _Expanded, "Account code", [AccountCode], "Day", [Day] )
- RichardLinderma1 year agoHelper I
This is very interesting. Would you be able to adjust my code based on the AccountDayTable you provided, please?
- RichardLinderma1 year agoHelper I
Another thing to mention is that Number_Of_Days_Slicer is a column rather than a measure.
- v-saisrao-msft1 year agoCommunity Support
Hi RichardLinderma,
Thank you for reaching out to the Microsoft Fabric Forum Community.
Please check teh updated dax below:
AccountDayTable = VAR BaseTable = SUMMARIZE ( 'Future_Predicted', 'Future_Predicted'[AccountCode], "MaxDay", MAX('Future_Predicted'[Number_Of_Days_Slider]) ) VAR _Expanded = GENERATE ( BaseTable, ADDCOLUMNS ( GENERATESERIES (1, [MaxDay], 1), "Day", [Value] ) ) RETURN SELECTCOLUMNS ( _Expanded, "Account code", [AccountCode], "Day", [Day] )Thank you.