March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi, everyone.
I am stuggling with something. I am using the Path calculation to get a hierarchical path (e.g. A|B|C). When I reference this with a measure using PathContains and Selected Value, it works fine. Here is a measure I am using:
Rolled Up Total Est Prem := VAR c = SELECTEDVALUE ( Users[internalemailaddress] ) RETURN CALCULATE ( SUM ( Opportunities[Total Est. Prem.] ), ALLSELECTED ( Opportunities ), PATHCONTAINS ( Opportunities[Manager Hierarchy], c ) )
I also created a measure that shows the selected value:
User Selected Value := SELECTEDVALUE(Users[internalemailaddress])
But then when I create a calculated column to test a member of the path hierarchy (e.g. L1), the User Selected Value measure above only returns a blank. Here is the code:
Hierarchy SelectedValue = if(Opportunities[L1]=[User Selected Value],TRUE(),FALSE())
Any idea how to get this working?
Thanks, Scott
Solved! Go to Solution.
Hi Scott,
This is the trick of context. The context of SELECTEDVALUE in a calculated column is the whole table, So it would always return blank because there isn't a single selected value. Maybe you can try it with CALCULATE. But the calculated column won't interact with the slicer or filter in the report view.
Column = CALCULATE(SELECTEDVALUE(DimProduct[BrandName], "NOT Found"))
Best Regards,
Dale
Hi @Anonymous,
Could you please mark the proper answer as a solution?
Best Regards,
Dale
Hi Scott,
This is the trick of context. The context of SELECTEDVALUE in a calculated column is the whole table, So it would always return blank because there isn't a single selected value. Maybe you can try it with CALCULATE. But the calculated column won't interact with the slicer or filter in the report view.
Column = CALCULATE(SELECTEDVALUE(DimProduct[BrandName], "NOT Found"))
Best Regards,
Dale
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
203 | |
141 | |
107 | |
73 | |
70 |