cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NadaBen Regular Visitor
Regular Visitor

if all

I  have a measure : "rupture" which is calculated (substraction) based on two other measures "Stock Week " and stock  Week-1. 

I have good results when i'm in a weekly bucket, but when i'm in total, it gives me the result based on the total of "Stock Week " and "stock Week-1".

 

I would like to sum the "rupture "  of the weekly buckets when  i'm in All(week).

Capture123.PNG

Thanks in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: if all

Hi @NadaBen,

 

If you add some specify filter in measure, it will return the wrong result at total row. In my opinion, you can add a condition to filter the total row and add the specify calculation on it.

 

For example:

 

Condition Calculate = 
var currRowLabel=LASTNONBLANK('Table'[Date].[Month],'Table'[Date].[Month])
var currColumnLabel=MAX('Table'[Date].[Year])
return
if(COUNTROWS('Table')=COUNTROWS(ALL('Table')),
	"all",//all
	if(COUNTROWS('Table')=COUNTROWS(FILTER(ALL('Table'),[Date].[Month]=currRowLabel)),
		"row",//row
		if(COUNTROWS('Table')=COUNTROWS(FILTER(ALL('Table'),[Date].[Year]=currColumnLabel)),
			"column",//column
			SUM('Table'[Amount]))))

 

Capture.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

3 REPLIES 3
Highlighted
NadaBen Regular Visitor
Regular Visitor

Re: if all

Any help would be appreciated 🙂
Community Support Team
Community Support Team

Re: if all

Hi @NadaBen,

 

If you add some specify filter in measure, it will return the wrong result at total row. In my opinion, you can add a condition to filter the total row and add the specify calculation on it.

 

For example:

 

Condition Calculate = 
var currRowLabel=LASTNONBLANK('Table'[Date].[Month],'Table'[Date].[Month])
var currColumnLabel=MAX('Table'[Date].[Year])
return
if(COUNTROWS('Table')=COUNTROWS(ALL('Table')),
	"all",//all
	if(COUNTROWS('Table')=COUNTROWS(FILTER(ALL('Table'),[Date].[Month]=currRowLabel)),
		"row",//row
		if(COUNTROWS('Table')=COUNTROWS(FILTER(ALL('Table'),[Date].[Year]=currColumnLabel)),
			"column",//column
			SUM('Table'[Amount]))))

 

Capture.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

NadaBen Regular Visitor
Regular Visitor

Re: if all

Many Thanks 

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 343 members 3,482 guests
Please welcome our newest community members: