cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Re: Differrance betwee two values in rows

Hi Zoe,

Do you mean like this?

codering max trances.JPG

Highlighted
Super User II
Super User II

Re: Differrance betwee two values in rows

hello @Anonymous 

 

I think there are some misunderstandings. Tried to figure out a solution for you. Please check if the concept of this codes works for you.

let
	TableA = #table
	(
		{"Object","Max Allowed"},
		{
			{"A","15"},	{"B","10"},	{"C","10"},	{"D","5"}
		}
	),
    ChangedTypeA = Table.TransformColumnTypes(TableA,{{"Max Allowed", Int64.Type}}),
    TableB = #table
	(
		{"Object","Times"},
		{
			{"A","1"},	{"B","1"},	{"C","1"},	{"D","1"},	{"A","1"},	{"B","1"},	{"C","1"},	{"D","1"},	{"A","1"},	{"B","1"},	{"C","1"},	{"D","1"},	{"A","1"},	{"B","1"},	
			{"C","1"},	{"D","1"},	{"A","2"},	{"B","3"},	{"C","4"},	{"D","5"},	{"A","6"},	{"A","7"},	{"A","8"},	{"B","9"},	{"B","10"},	{"D","11"},	{"D","12"},	{"D","13"},	
			{"D","14"}
		}
	),
    ChangedTypeB = Table.TransformColumnTypes(TableB,{{"Times", Int64.Type}}),
    JoinTables = Table.NestedJoin
    (
        ChangedTypeA,
        "Object",
        ChangedTypeB,
        "Object",
        "Times"
    ),
    CountRowTimes = Table.AggregateTableColumn(JoinTables, "Times", {{"Times", List.Count, "Count of Times"}}),
    AddCheck = Table.AddColumn(CountRowTimes, "Check", each if [Count of Times]>[Max Allowed] then "check" else "not check")

in
	AddCheck

Copy paste this code to the advanced editor to see how the solution works. If this solution fits your need, copy and past a part of it and implement it in your query.

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

Highlighted
Anonymous
Not applicable

Re: Differrance betwee two values in rows

Hi Jimmy,

I'm getting an error on this "EOF" missing.

 

 

Highlighted
Super User II
Super User II

Re: Differrance betwee two values in rows

Hello @Anonymous 

 

copy the data into the advanced editor. You don't have appended any screenshot, but I suppose you have copied into the formula bar

 

Jimmy

Highlighted
Anonymous
Not applicable

Re: Differrance betwee two values in rows

Hi Jimmy,

I'd copied it in the avanced editor.

 

I got another solution where they say:

Difference = (COUNTA('Codering max trances' [Max omvang standaard eenheid ZIN]) - COUNTA('FeitLevering'[aVolume])

 

This looks like a simple solution, However for some reason there is no result. (The wheel keeps spinning)

Highlighted
Super User II
Super User II

Re: Differrance betwee two values in rows

Hello @Anonymous 

 

the solution I proposed is Power Query. That what you are stating is DAX. 

If the DAX solution is okay, go for it. 

However, if you are copying my code into the advanced editor, it should not spin. Is a straightforward code. This is the result of combining the example data in my code

image.png

 

Jimmy

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Differrance betwee two values in rows

@Jimmy801 

Yes its work now 🙂

 

I'd tried it in a current table, now i just made a new query 🙂

 

Thanx a lot

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Don't miss the Power BI Dev Camp this week!

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors