Forum Discussion
Dynamic calculate based on the parameter value provided by user
- 3 years ago
Hi , Anonymous
Thanks for your quick response!I download your pbix file and i can open it successfully!
For your two needs , here are the steps you can refer to :
(1)We can just modify your [IsInBuffer-check] measure like this:IsInBuffer-check = if(min(SummarizedTable[EndingOnHand])<=0 && min(SummarizedTable[Weekdate])<= [Today+Weeknum], "N","Y")Then we can get this:
(2)For your second need , we can click "New Table" and enter this:
Table 3 = ADDCOLUMNS( ADDCOLUMNS ( SUMMARIZE ( RawDataTable,RawDataTable[Filekey],RawDataTable[Item],RawDataTable[Itemkey],RawDataTable[location],RawDataTable[Productname],RawDataTable[Source] ), "Weekdate", var _t = CALCULATETABLE('RawDataTable') var _t2 = FILTER(_t,[EndingOnHand]<=0) return IF(MINX(_t2,[Weekdate])=BLANK() , MINX(_t,[Weekdate]) ,MINX(_t2,[Weekdate])) ), "EndingOnHand",var _date= [Weekdate] var _t = FILTER( CALCULATETABLE('RawDataTable'),[Weekdate]=_date) return minx(_t,[EndingOnHand]) )Then we can get the result table like this:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , Anonymous
Thanks for your sample pbix file , i download in my side but when i can not open it due to it has a sensitivity label for your pbix file.
For your first need,you want to create a flag that changes dynamically based on user input. First of all, it must be clear that calculated columns cannot obtain user input values, because calculated columns are row contexts and cannot obtain user input at the report page level.So, for your first requirement, we can only use measure to dynamically obtain user input and return flag.
For your second requirement, do you want to create a new table? Similarly, calculation tables cannot obtain user input to achieve dynamics.If you still want to display some data you want based on user input, you can only use measures to filter tables or calculate values.
Finally, for your two requirements, can you provide some test data and give the correct values (in tabular form) that you want to get in the end?This would make the question more clear as I don't quite understand your second requirement!
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly