Forum Discussion
Need Dax for below logic
Hi All,
The table having below columns
| ItemNo | Price | Type |
| LT1 | 100 | Agency |
| LT1 | 50 | Executive |
| LT1 | 0 | Reprasentative |
| LT2 | 10 | Agency |
| LT2 | 20 | Executive |
| LT2 | 30 | Executive |
| LT2 | 70 | Reprasentative |
Expecting result is; I am considering only Type "Reprasentative" and "Executive", And if there are two executives or representative need to add the price of then "Reprasentative" or "Executive" individually.
| ItemNo | Price | Agency Pricy | Type |
| LT1 | 50 | 100 | Executive |
| LT2 | 50 | 10 | Executive |
| LT2 | 70 | 10 | Reprasentative |
Thanks in advance.
Hi RadhakrishnaE ,
Try this measure:
Price 2 =IF(SUM('Table'[Price])=0,BLANK(),IF(SELECTEDVALUE('Table'[Type])="Executive"||SELECTEDVALUE('Table'[Type])="Reprasentative",SUM('Table'[Price]),BLANK()))Result:If I answered your question, please mark it as a solution to help other members find it more quickly.
3 Replies
- AnonymousNot applicable
RadhakrishnaE If I got you right you need simple measure like Sum_NoPrice=SUM(Table[NoPrice]). Then create visual table, drag on values 'Item', 'Sum_NoPrice', 'Type', and filter 'Type' field.
- jppv20
Solution Sage
Hi RadhakrishnaE ,
Try this measure:
Price 2 =IF(SUM('Table'[Price])=0,BLANK(),IF(SELECTEDVALUE('Table'[Type])="Executive"||SELECTEDVALUE('Table'[Type])="Reprasentative",SUM('Table'[Price]),BLANK()))Result:If I answered your question, please mark it as a solution to help other members find it more quickly.
- Samarth_18
Community Champion
You can use below measure:-
Measure = VAR result = CALCULATE ( SUM ( 'Table'[Price] ), FILTER ( 'Table', 'Table'[Type] IN { "Reprasentative", "Executive" } ) ) RETURN IF ( result = 0, BLANK (), result )Thanks,
Samarth