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
Ianbooth
Frequent Visitor

Calculate total of a dax measure

Good evening,

I have a simple dax measure..

In sla = if(sum(date x)=(date y),0,1)

 

This returns a 1 if an item is within sla 

 

I now need a measure to add up all the 1s to collate a total. 

I have tried using sumx of the above measure but the total returns 1

 

Please help. 

 

 

 

 

 

 

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Write a calculated column formula

Test = 1*(Data[Date X]=Data[Date X])

Write this measure

Count = calculate(countrows(Data),Data[Test]=1)

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-tangjie-msft
Community Support
Community Support

Hi @Ianbooth ,

 

According to your description, here are my steps you can follow as a solution.

(1) We can create a measure.

Total = COUNTROWS(FILTER(ALL('Table'),'Table'[In sla]=1))

(2) Then the result is as follows.

vtangjiemsft_0-1675133100575.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

amitchandak
Super User
Super User

@Ianbooth , based on the column in visual

 

Sumx(Summarize(Fact, item[item], "_1", [In sla]) ,[_1])

 

Add more columns to summarize if needed

Thank you. What fact doesn't seem to work? And what is the item ?

 

 

 

 

 

 

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.