Forum Discussion
Table visuals report
Hi bzeeblitz ,
To achieve the desired Power BI report that filters data based on the conditions Createdwhen = 'PO created yesterday' and onhand > 9 months, follow these steps using DAX. First, import the Cycle, POItem, and Demand tables into Power BI and establish relationships between them. Specifically, link Cycle[Item#] to POItem[Item#] and Cycle[Item#] to Demand[Item Number].
Next, create a calculated table named FilteredPOItem to filter the POItem table. Use the DAX formula:
FilteredPOItem =
FILTER(
POItem,
LOWER(POItem[Createdwhen]) = "po created yesterday"
)
Similarly, create another calculated table named FilteredDemand to filter the Demand table. Use the formula:
FilteredDemand =
FILTER(
Demand,
LOWER(Demand[onhand>9 months]) = "more than 9 months onhand"
)
After filtering the individual tables, create a combined calculated table that merges the filtered data from Cycle, FilteredPOItem, and FilteredDemand. Use the DAX formula:
FilteredTable =
SUMMARIZECOLUMNS(
Cycle[Item#],
Cycle[Order:Card Type],
Cycle[PO#],
Demand[onhand>9 months],
POItem[Vendor name],
FILTER(
FilteredPOItem,
FilteredPOItem[Item#] = Cycle[Item#]
),
FILTER(
FilteredDemand,
FilteredDemand[Item Number] = Cycle[Item#]
)
)
Finally, add a table visual to the report and include the following columns: Cycle[Item#], Cycle[Order:Card Type], Cycle[PO#], Demand[onhand>9 months], and POItem[Vendor name]. This ensures the report dynamically filters and displays data meeting the specified conditions. Ensure the relationships in the model are correctly set up to enable filtering and cross-referencing between the tables. Let me know if any further assistance is needed.
Best regards,
FilteredDemand =
FILTER(
Demand,
LOWER(Demand[onhand>9 months]) = "more than 9 months onhand"
)
im getting cannot find name error onhand>9 months in this line of code LOWER(Demand[onhand>9 months]) = "more than 9 months onhand"
ALso im getting error cannot find createdwhen column in
LOWER(POItem[Createdwhen]) = "po created yesterday"
FilteredPOItem =
FILTER(
POItem,
LOWER(POItem[Createdwhen]) = "po created yesterday"
)
- bzeeblitz1 year agoHelper IV
Also createdwhen and Onhand>9 months is a calculated field ,i mean this below formula is existed in this columns in demand table and poitem table
Onhand>9months = if('Demand'[Months of Available Inventory]>9,"More than 9 months On-Hand","Less than 9 months On-Hand")
CreatedWhen = if('POitem'[Date: Line Created].[Day] = day(TODAY()-1),"PO Created Yesterday","PO Not Created Yesterday")