cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
o59393
Post Prodigy
Post Prodigy

Summarize various calculate functions into one

Hi all

 

I created 8  dax function that returns the count of ocassions the "Government time" is within:

 

0 - 30 days

30 - 60 days

60 - 90 days

90 - 120 days

120 - 150 days

150 - 180 days

180 - 210 days

210 and above

 

Example for the 180-210 days

 

 

 

CALCULATE(

COUNT('Sanitary Registration Mass Report'[Cycle Time (Process)]),FILTER('Sanitary Registration Mass Report','Sanitary Registration Mass Report'[Cycle Time (Process)]>180&&'Sanitary Registration Mass Report'[Cycle Time (Process)]<=210)

)

 

 

 

This is kinda unefficient so I wanted to know if there is a way to have in a single dax function all this bunch of dax measures.

 

I attach PBIx.

 

https://1drv.ms/u/s!ApgeWwGTKtFdhiKPn67mXUs1txlw?e=8SvWVE

 

Thanks.

2 ACCEPTED SOLUTIONS
az38
Super User
Super User

Hi 

@o59393

 try this file https://ufile.io/whlx43iq 

I added dimension table dimIntervals with all possible intervals and a calculated column in your table

 

Interval = calculate(FIRSTNONBLANK(dimIntervals[Label];1); FILTER(ALL(dimIntervals); dimIntervals[MinPeriod] < 'Sanitary Registration Mass Report'[Cycle Time (Process)] && dimIntervals[MaxPeriod]>='Sanitary Registration Mass Report'[Cycle Time (Process)]) ) ​

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn

 

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

You are welcome.  If my previous reply helped, please mark that as Answer.

ABCD is just the title of the column.  You may give any meaningful title within the double quotes.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.  I have only measures to solve this question.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks @Ashish_Mathur 

 

What is the "ABCD" for?


Regards.

You are welcome.  If my previous reply helped, please mark that as Answer.

ABCD is just the title of the column.  You may give any meaningful title within the double quotes.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

az38
Super User
Super User

Hi 

@o59393

 try this file https://ufile.io/whlx43iq 

I added dimension table dimIntervals with all possible intervals and a calculated column in your table

 

Interval = calculate(FIRSTNONBLANK(dimIntervals[Label];1); FILTER(ALL(dimIntervals); dimIntervals[MinPeriod] < 'Sanitary Registration Mass Report'[Cycle Time (Process)] && dimIntervals[MaxPeriod]>='Sanitary Registration Mass Report'[Cycle Time (Process)]) ) ​

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn

 

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

Perfect!!!

 

Thanks @az38 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!