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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
diogovaz
Frequent Visitor

SQL to DAX

Good Morning guys,

 

I need help:
How can I transform this expression in SQL into a Measure in DAX:

select count(distinct id)
from
(select distinct _acc.id
from eos_user_account _acc
inner join eos_parking_session _pkg on (_pkg.account_id = _acc.id and _pkg.create_timestamp>='2018-01-01 00:00:00' and _pkg.create_timestamp<='2018-01-31 00:00:00')
union
select distinct _acc.id
from eos_user_account _acc
inner join eos_asset_owner _own ON _own.user_account_id = _acc.id
inner join eos_consumable_consumable _pass on (_pass.owner_id = _own.id and _pass.create_timestamp>='2017-01-01 00:00:00' and _pass.create_timestamp<='2018-01-31 00:00:00')) t;

Thanks for your help,

Diogo

1 REPLY 1
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @diogovaz,

 

Please share a dummy sample file. There are something we can't see from the SQL code. Such as,

1. The exact relationship, though we can see the join fields, it's the relationship fields works in DAX;

2. The relationship type (1:1, 1:*). 

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.