Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 216485

DAX count based on multiple conditions of multiple columns

$
0
0

Hi All,

I am facing an issue while creating a DAX calculated measure in tabular model SQL Server 2014. 
The dimension table has data like

CategoryCode   TypeCode   ItemCode      ItemSize
     C1                    P1              1                     S
     C1                    P1              2                     M
     C1                    P1              3                     L
     C2                    P2              4                     S
     C2                    P2              5                     M
     C3                    P3              6                     S
     C3                    P3              7                     M

I want to write a DAX expression to calculate
(if count of TypeCodes which fall under CategoryCode C1 and C2 and ItemSize in S,M,L)<>0 then "FR"
((if count of TypeCodes which fall under CategoryCode C1 and C2 and ItemSize in S,L)<>0) AND ((if count of TypeCodes which falls under CategoryCode C1 and C2 and ItemSize in M)=0 then "PR")

Kindly help me in implementing this logic.
Thank You.


Viewing all articles
Browse latest Browse all 216485

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>