The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello Everyone
I am doing tableau migration to Power BI, So i am converting one single form from tableau code to dax
Tableau Formula:
(COUNTD(IF ([Sales Type]="AS" AND [Type]="Subs") THEN [Ord Nbr] ELSE NULL END))+
SUM(IF ([Sales Type]="PS" AND [Type]="Subs") THEN [Qty] ELSE 0 END)
I have tried this below dax
Solved! Go to Solution.
Hi @Gaurav51478 ,
Please have a try.
Column =
VAR _COUNTD =
CALCULATE (
DISTINCTCOUNT ( 'TABLENAME'[ORD_NBR] ),
FILTER (
'TABLENAME',
'TABLENAME'[Type] = "Subs"
&& 'TABLENAME'[SALES_TYPE] = "APOS"
)
)
VAR RESULT =
CALCULATE (
SUM ( 'TABLENAME'[QTY] ),
FILTER (
'TABLENAME',
'TABLENAME'[Type] = "Subs" & 'TABLENAME'[SALES_TYPE] = "POS"
)
)
RETURN
_COUNT + RESULT
If I have misunderstood your meaning, please provide your pbix file without privacy information and your desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Gaurav51478 ,
Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Gaurav51478 ,
Please have a try.
Column =
VAR _COUNTD =
CALCULATE (
DISTINCTCOUNT ( 'TABLENAME'[ORD_NBR] ),
FILTER (
'TABLENAME',
'TABLENAME'[Type] = "Subs"
&& 'TABLENAME'[SALES_TYPE] = "APOS"
)
)
VAR RESULT =
CALCULATE (
SUM ( 'TABLENAME'[QTY] ),
FILTER (
'TABLENAME',
'TABLENAME'[Type] = "Subs" & 'TABLENAME'[SALES_TYPE] = "POS"
)
)
RETURN
_COUNT + RESULT
If I have misunderstood your meaning, please provide your pbix file without privacy information and your desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
What issue did you encounter when you tried it?
Note: Probably a bad idea to try and add NULL and a number - both in Tableau and Power BI.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the July 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
109 | |
68 | |
46 | |
42 |
User | Count |
---|---|
188 | |
86 | |
77 | |
74 | |
60 |