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

CALCULATE CLARIFICATION

Hello Guys,,

I just want only a clarification regarding this basic dax systax

Ok let assume I have a TableA and TableB with 
1 to many Relationship
PROBLEM 1
What is the diff of these 2 dax query
= Calculate(DistinctCount(TableBColumn), TableBcolumnx=1,TableBcolumnxx=2,Filter(TableA, TableAColumnm=3)
)
= Calculate(DistinctCount(TableBColumn), TableBcolumnx=1,TableBcolumnxx=2, TableAColumnm=3
)
PROBLEM 2
Ok let assume I have a TableA and TableB with 
1 to many Relationship
I create new table from tableB ,let assume Table C = SummurizeColumn(TablebID,"MIN TEST",MIN(TablebColumnx),"MIN DEPLOYED",MIN(TablebColumnx)
Not the TableC have a relationship with B as Many to 1

= Calculate(DistinctCount(TableBColumnID), TableBcolumnx=B,TableBcolumnxx=2,Filter(TableC, TableCColumnm=3)
)
= Calculate(DistinctCount(TableBColumn), TableBcolumnx=1,TableBcolumnxx=2, TableCColumnm=3
)
I Hope someone will clarify to me
I tried them and different Result 
Thanks in advance

1 REPLY 1
AlB
Super User
Super User

Hi @Anonymous 

PROBLEM 1

The second statement is syntax sugar for: 

=Calculate(DistinctCount(TableBColumn), TableBcolumnx=1,TableBcolumnxx=2, Filter(ALL(TableAColumnm), TableAColumnm=3)
)

The only difference with the first one is the ALL, which overrides existing filters on TableAColumnm

PROBLEM 2

I don't quite follow. It would help if you can share the real example, pbix

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

 

 

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.