Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I'm really struggling to find solution for a longer time now. I went through all the advices here, but non of them is working to me.
I'm working in Direct query mode and found some solutions to this already, but nothing is working as I need.
I have one measure already, which is still not showing the highest category number in every row per child ID:
#Max Cat =
VAR ctl = SELECTEDVALUE([child ID])
VAR dupl = FILTER(ALLSELECTED([table]),[child ID]=ctl)
RETURN
MAXX(table, table[category number] )
I'd need the table look like this:
Solved! Go to Solution.
Hi @Zuzana ,
In Direct Query mode, if you're trying to show the maximum category number for each child ID across all related parent ID rows, your current DAX measure isn't correctly removing the row-level filter context. To achieve the desired result—where each row displays the same maximum category number per child ID—you should revise the measure to explicitly remove filters on everything except the child ID. You can use the ALLEXCEPT function to achieve this. Here's the corrected measure:
#Max Cat =
CALCULATE(
MAX('your_table'[category number]),
ALLEXCEPT('your_table', 'your_table'[child ID])
)
This version ensures that the measure returns the same maximum value of category number for all rows sharing the same child ID, regardless of other filters in the table. Just replace 'your_table' with the actual name of your table. This approach works in Direct Query mode and avoids the pitfalls of SELECTEDVALUE not resolving correctly due to row context limitations.
Best regards,
Hi @Zuzana ,
In Direct Query mode, if you're trying to show the maximum category number for each child ID across all related parent ID rows, your current DAX measure isn't correctly removing the row-level filter context. To achieve the desired result—where each row displays the same maximum category number per child ID—you should revise the measure to explicitly remove filters on everything except the child ID. You can use the ALLEXCEPT function to achieve this. Here's the corrected measure:
#Max Cat =
CALCULATE(
MAX('your_table'[category number]),
ALLEXCEPT('your_table', 'your_table'[child ID])
)
This version ensures that the measure returns the same maximum value of category number for all rows sharing the same child ID, regardless of other filters in the table. Just replace 'your_table' with the actual name of your table. This approach works in Direct Query mode and avoids the pitfalls of SELECTEDVALUE not resolving correctly due to row context limitations.
Best regards,
Hi @DataNinja777 ,
Thank you very much for your solution. This seems to be working well. 🙂
You saved me!
Have a wonderful weekend.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 11 | |
| 9 | |
| 5 | |
| 5 |