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
Hello,
i was wondering is there a way to write a measure with a condition which refers to a column the result is needed from?
I think it may be difficult, so i will try to explain the situation.
In Power Apps we have a mapping environment. I wont go into mapping details, but the result we are having looks something like in the photo column A and B.
I want to have a matrix table where we would be able drill down from first level to second. It means top level should be P.1,P.2,P.3 and their values should come from second level codes.
The issue is that we dont have somekind of levels, we have codes and values in 2 columns, so i was wondering is there a way to create a measure if Code is P.1 it should return second level codes - P.1.1 (600) and P.1.2 (400). The result i want is also in the picture.
I would be able to create a new column, but i can only create a measure since the data is taken form Power BI model and can not be edited.
Maybe it is a need to change the logic somehow in power apps mapping?
Thank you.
Solved! Go to Solution.
The below should work, but it will be slow and depending on the size of your data it might not be practicable
Aggregated Value =
VAR _CurrentCode =
SELECTEDVALUE ( 'Table'[Code] )
VAR Result =
IF (
NOT ISBLANK ( _CurrentCode ),
CALCULATE (
SUM ( 'Table'[Value] ),
CONTAINSSTRING ( 'Table'[Code], _CurrentCode )
)
)
RETURN
Result
Ideally you would be able to build a parent child hierarchy which explicitly details which codes belong where, but that isn't always possible.
The below should work, but it will be slow and depending on the size of your data it might not be practicable
Aggregated Value =
VAR _CurrentCode =
SELECTEDVALUE ( 'Table'[Code] )
VAR Result =
IF (
NOT ISBLANK ( _CurrentCode ),
CALCULATE (
SUM ( 'Table'[Value] ),
CONTAINSSTRING ( 'Table'[Code], _CurrentCode )
)
)
RETURN
Result
Ideally you would be able to build a parent child hierarchy which explicitly details which codes belong where, but that isn't always possible.
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 30 | |
| 23 |