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

sql to DAX

Hi,
Can you please let me know if the following sql should give the same result as the followed DAX?
Thank you

 

select
p.[field1], count(distinct p.[field3]) AS "Mycount"
from
TableP AS p
INNER JOIN TableH AS h ON p.ID = h.ID
where
h.[field7] > 0
AND p.[field2] = 'some text'
group by
p.[field1]
having count(distinct p.[field3]) >= 2
--------------------------------------------------------
FILTER (
SUMMARIZE (
'TableP'
,'TableP'[field1],
'TableP'[field2],
"Mycount", DISTINCTCOUNT ( 'TableP'[field3] ),
),
[price] > 0
&& SEARCH ( "some text", 'TableP'[field2], 1, 0 )
&& not ISBLANK('TableP'[field3])
&& [MyCount] >= 2
)

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can go ahead with anything as long as it's giving the correct result.. 🙂

Thanks.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Try to use below DAX. Just replace your table and column names.

You can add more filters too.

FILTER( CALCULATETABLE( SUMMARIZECOLUMNS(DimProduct[EnglishProductName], 
		DimProduct, 
		"Mycount", 
		DISTINCTCOUNT( FactInternetSales[OrderDate]) 
		) 
	),
	CALCULATE(DISTINCTCOUNT( FactInternetSales[OrderDate])) >= 3 &&
	DimProduct[EnglishProductName]="some text"
)

Thanks.

Anonymous
Not applicable

Hi,
This seems to be giving the similar result to my filter and summarize dax

Anonymous
Not applicable

You can go ahead with anything as long as it's giving the correct result.. 🙂

Thanks.

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