The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi guys, can somebody help me with this issue?
I need to order product type based on slicer selection channel from another table.
If I choose eshop, I want my product type order by column index eshop.
If I choose B&M, I wan my product type order by column index B&M.
I tried to add new column, but it is not working:
DynamicSortIndex =
IF(
SELECTEDVALUE(FACT_Sales[Channels]) = "B&M",
DIM_Product[Index B&M],
DIM_Product[Index eshop])
my tables: FACT_Sales[Channels]
DIM_Product[Index B&M]
link to download sample file pbix.
thank you for your help
Solved! Go to Solution.
Hi @kovacikm78
Add a measure to your model using the following DAX:
DynamicSortIndex =
VAR SelectedChannel = SELECTEDVALUE(FACT_Sales[Channels])
RETURN
SWITCH(
TRUE(),
SelectedChannel = "B&M", MAX(DIM_Product[Index B&M]),
SelectedChannel = "eshop", MAX(DIM_Product[Index eshop]),
MAX(DIM_Product[Index B&M]) -- Default or when no selection is made
)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Thank you very much for nice workaroud. Working like a charm
Hi @kovacikm78
Add a measure to your model using the following DAX:
DynamicSortIndex =
VAR SelectedChannel = SELECTEDVALUE(FACT_Sales[Channels])
RETURN
SWITCH(
TRUE(),
SelectedChannel = "B&M", MAX(DIM_Product[Index B&M]),
SelectedChannel = "eshop", MAX(DIM_Product[Index eshop]),
MAX(DIM_Product[Index B&M]) -- Default or when no selection is made
)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
User | Count |
---|---|
57 | |
56 | |
53 | |
50 | |
32 |
User | Count |
---|---|
165 | |
85 | |
69 | |
47 | |
45 |