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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
Community Champion
Community Champion

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/
az38
Community Champion
Community Champion

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

Perfect!!!

 

Thanks @az38 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.