Forum Discussion

Chandrashekar's avatar
Chandrashekar
Resolver III
2 years ago
Solved

Dax Help

Hello Team,

 

How to write DAX to get below result as Column D & E.

 

Regards,

Chandrashekar B

  • ERD's avatar
    ERD
    2 years ago

    For the totals, create 2 more measures like:

    result = 
    IF(
    	HASONEVALUE('Table'[Si No]),
    	[closed],
    	SUMX(
    		VALUES('Table'[Si No]), [closed])
    	)
    )

4 Replies

  • ERD's avatar
    ERD
    Community Champion

    Chandrashekar , you can use this measure:

    closed =
    SWITCH (
        TRUE (),
        NOT ISBLANK ( SELECTEDVALUE ( 'Table'[Date_Closed] ) ), 1,
        NOT ISBLANK ( SELECTEDVALUE ( 'Table'[Date_opened] ) ), BLANK (),
        0
    )

    Use similar approach for the opened case.

    • Chandrashekar's avatar
      Chandrashekar
      Resolver III

      Hello,

       

      Thanks for the reply but am getting total incorrect.

      Regards,

      Chandrashekar B

       

      • ERD's avatar
        ERD
        Community Champion

        For the totals, create 2 more measures like:

        result = 
        IF(
        	HASONEVALUE('Table'[Si No]),
        	[closed],
        	SUMX(
        		VALUES('Table'[Si No]), [closed])
        	)
        )