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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Avivek
Post Partisan
Post Partisan

Need help with DAX

Hello Everyone,

 

I need help with a dax, I have the requirement to create a Total procedure and its percentage, the dax i created was 

Total Procedures = CALCULATE(SUM('Procedure Fact'[C501B_QTY]),ALLEXCEPT('Tag Usage Fact',
'Tag Usage Fact'[TAG_ID]),ALLEXCEPT('Systems Dim','Systems Dim'[SYSTEM_NM])
 

Capture.PNG

And this is how its filtering my data.

The dax basically shows a tag is taken by a TAG OWNER, and what % of time he utilized and % of time someone else borrowed from and used(Order Owner).From the above eg., Anu has a tag which she used 77.7% time and Ajay used 22.2% time

Now the issues come when I am trying to select a column from another table.

Capture.PNG

All my details are from Tag table but when I bring columns from either set or system table then i am getting issue.

 

Capture.PNG

But this is how it works when i bring set name from set name. What is the change i need to do in my dax or is there something i am missing.

Can please someone help me with this please.

 

 

 

 

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Avivek ,

 

According to your screenshot, I think your issue will appear after you add [SET_NAME] from "Set Dim" table into visual. I think this should be caused by ALLEXCEPT()  in your data model.

How did you relate "Procedure Fact" and "Tag Usage Fact" table in your data model, by [Tag ID] columns?

I suggest you to try ALL() function and Filter() in your code.

My Sample:

RicoZhou_0-1656404227450.png

Measure:

Total Procedures =
CALCULATE (
    SUM ( 'Procedure Fact'[C501B_QTY] ),
    FILTER (
        ALL ( 'Procedure Fact' ),
        'Procedure Fact'[TAG_ID] = MAX ( 'Tag Usage Fact'[TAG_ID] )
    )
)

Result is as below.

RicoZhou_1-1656404308878.png

 

Best Regards,
Rico Zhou

 

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

 

View solution in original post

1 REPLY 1
v-rzhou-msft
Community Support
Community Support

Hi @Avivek ,

 

According to your screenshot, I think your issue will appear after you add [SET_NAME] from "Set Dim" table into visual. I think this should be caused by ALLEXCEPT()  in your data model.

How did you relate "Procedure Fact" and "Tag Usage Fact" table in your data model, by [Tag ID] columns?

I suggest you to try ALL() function and Filter() in your code.

My Sample:

RicoZhou_0-1656404227450.png

Measure:

Total Procedures =
CALCULATE (
    SUM ( 'Procedure Fact'[C501B_QTY] ),
    FILTER (
        ALL ( 'Procedure Fact' ),
        'Procedure Fact'[TAG_ID] = MAX ( 'Tag Usage Fact'[TAG_ID] )
    )
)

Result is as below.

RicoZhou_1-1656404308878.png

 

Best Regards,
Rico Zhou

 

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

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.