cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
McCow Member
Member

Re: Need help with a measure

@Shamatix,

try this and let me know pls if it work correct or no on yours data:

MomsGrundlag 2 = IF(CALCULATE(COUNTROWS('Indfortoldning');ALLEXCEPT('Indfortoldning';Indfortoldning[Løbenummer]))<2 || 
	AVERAGEX('Indfortoldning';Indfortoldning[Moms grundlag]) <> MEDIANX('Indfortoldning';Indfortoldning[Moms grundlag]); 
	AVERAGE(Indfortoldning[Moms grundlag]);
	BLANK()
)//if
Shamatix Member
Member

Re: Need help with a measure


@McCow wrote:

@Shamatix,

try this and let me know pls if it work correct or no on yours data:

MomsGrundlag 2 = IF(CALCULATE(COUNTROWS('Indfortoldning');ALLEXCEPT('Indfortoldning';Indfortoldning[Løbenummer]))<2 || 
	AVERAGEX('Indfortoldning';Indfortoldning[Moms grundlag]) <> MEDIANX('Indfortoldning';Indfortoldning[Moms grundlag]); 
	AVERAGE(Indfortoldning[Moms grundlag]);
	BLANK()
)//if

Thanks a ton for the help, almost there:

https://i.imgur.com/FVnYWXK.png 

 

 

 

 

 

As you see on the above picture, it makes this one blank, eventho the momsgrundlag (vatamount)  is the same  asd.png

McCow Member
Member

Re: Need help with a measure

Fine @Shamatix

 

It's so, as you really need:

2017-12-17_22-22-58.png

 

 

Shamatix Member
Member

Re: Need help with a measure


@McCow wrote:

Fine @Shamatix

 

It's so, as you really need:

2017-12-17_22-22-58.png

 

 


 

 

 

 

 

 

 

 

 

 

http://ge.tt/5XiQiln2

Take a look here.

For whatever reason it becomes blank eventho "Momsgrundlag" is the same for the same løbenummer

McCow Member
Member

Re: Need help with a measure

OK, @Shamatix, you right, possible my mistake.

pls check this formula (based on previous):

MomsGrundlag 2 = IF(CALCULATE(COUNTROWS('Indfortoldning');ALLEXCEPT('Indfortoldning';Indfortoldning[Løbenummer]))<2 || 
//	AVERAGEX('Indfortoldning';Indfortoldning[Moms grundlag]) <> MEDIANX('Indfortoldning';Indfortoldning[Moms grundlag]);
	VARX.P('Indfortoldning';Indfortoldning[Moms grundlag]) = 0;
	AVERAGE(Indfortoldning[Moms grundlag]);
	BLANK()
)//if

 MfG

Shamatix Member
Member

Re: Need help with a measure


@McCow wrote:

OK, @Shamatix, you right, possible my mistake.

pls check this formula (based on previous):

MomsGrundlag 2 = IF(CALCULATE(COUNTROWS('Indfortoldning');ALLEXCEPT('Indfortoldning';Indfortoldning[Løbenummer]))<2 || 
//	AVERAGEX('Indfortoldning';Indfortoldning[Moms grundlag]) <> MEDIANX('Indfortoldning';Indfortoldning[Moms grundlag]);
	VARX.P('Indfortoldning';Indfortoldning[Moms grundlag]) = 0;
	AVERAGE(Indfortoldning[Moms grundlag]);
	BLANK()
)//if

 MfG



@McCow wrote:

OK, @Shamatix, you right, possible my mistake.

pls check this formula (based on previous):

MomsGrundlag 2 = IF(CALCULATE(COUNTROWS('Indfortoldning');ALLEXCEPT('Indfortoldning';Indfortoldning[Løbenummer]))<2 || 
//	AVERAGEX('Indfortoldning';Indfortoldning[Moms grundlag]) <> MEDIANX('Indfortoldning';Indfortoldning[Moms grundlag]);
	VARX.P('Indfortoldning';Indfortoldning[Moms grundlag]) = 0;
	AVERAGE(Indfortoldning[Moms grundlag]);
	BLANK()
)//if

 MfG


Getting closer and closerSmiley Very Happy

However this one turns up blank as well however here https://i.imgur.com/0XiOemi.png

it turns up blank as well (5 rows) same løbenummer and vatamount (moms grundlag)

Shamatix Member
Member

Re: Need help with a measure

here is an example 

http://ge.tt/3N1Fmln2

 

Dont know why that one becomes blank?

Shamatix Member
Member

Re: Need help with a measure


@McCow wrote:

OK, @Shamatix, you right, possible my mistake.

pls check this formula (based on previous):

MomsGrundlag 2 = IF(CALCULATE(COUNTROWS('Indfortoldning');ALLEXCEPT('Indfortoldning';Indfortoldning[Løbenummer]))<2 || 
//	AVERAGEX('Indfortoldning';Indfortoldning[Moms grundlag]) <> MEDIANX('Indfortoldning';Indfortoldning[Moms grundlag]);
	VARX.P('Indfortoldning';Indfortoldning[Moms grundlag]) = 0;
	AVERAGE(Indfortoldning[Moms grundlag]);
	BLANK()
)//if

 MfG


 

 

I really cant seem to figure out why its working correctly on some and not on some of the others.

Shamatix Member
Member

Re: Need help with a measure


@McCow wrote:

A simplest way without complicate calculation is separate measure + Card visualisation. Totals in the table must be OFF.


I tried to use the Card visualization with yoru measure but it turns out blank

PBIDesktop_2017-12-18_10-31-00.png

Shamatix Member
Member

Re: Need help with a measure

Hey McCow,

 

I have uploaded some sample data on the link below so you can see it still makes certain invoices blank, eventho the "Moms Grundlag" is the same amount for each line, so it should just show the avarage in this case.

 

http://ge.tt/4HRrAmn2

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 270 members 2,997 guests
Please welcome our newest community members: