Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RadhakrishnaE
Frequent Visitor

Need Dax for below logic

Hi All,

 

The table having below columns

 

ItemNoPriceType
LT1100Agency
LT150Executive
LT10Reprasentative
LT210Agency
LT220Executive
LT230Executive
LT270Reprasentative

 

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.

ItemNoPriceAgency PricyType
LT150100Executive
LT25010Executive
LT27010Reprasentative

 

Thanks in advance.

1 ACCEPTED SOLUTION
jppv20
Solution Sage
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:
jppv20_0-1634802263656.png

 

If I answered your question, please mark it as a solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
Samarth_18
Community Champion
Community Champion

Hi @RadhakrishnaE 

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

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

jppv20
Solution Sage
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:
jppv20_0-1634802263656.png

 

If I answered your question, please mark it as a solution to help other members find it more quickly.

Anonymous
Not 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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors