Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello everyone,
I want a table to contain the same column twice. The first should only output numbers if the account = 123 is output. The second column should only display numbers from the account = 456.
Reference Nr. | Account | Value | ||
773 | 123 | $ 5 | ||
773 | 456 | $ 10 | ||
773 | 999 | $ 9 | ||
773 | 288 | $ 100 |
That's what I want as a result. A column value 123 and a column 456, which only contain the amounts of the respective account. How do I do that?
This is how I imagine the result:
Reference Nr. | Customer | Value (123) | Value (456) | |||
773 | Alex | $ 5 | $ 10 | |||
220 | Dave | $ 2 | $ 3 | |||
221 | John | $ 22 | $ 30 | |||
222 | Doe | $ 91 | $ 33 |
Thank you for help !
Solved! Go to Solution.
Hi @azaterol ,
Based on your description I have created simple samples and you can check the results as follows:
This is not limited to your 123 or 456 rows, but the first and second rows of data
count = var _t = ADDCOLUMNS('Table',"count",RANKX(FILTER(ALL('Table'),[Reference Nr.]=EARLIER([Reference Nr.])),[Index],,ASC,Dense))
return SUMX(_t,[count])
For one = CALCULATE(MAX('Table'[Value]),FILTER('Table','Table'[count]=1))
For two = CALCULATE(MAX('Table'[Value]),FILTER('Table','Table'[count]=2))
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @azaterol ,
Based on your description I have created simple samples and you can check the results as follows:
This is not limited to your 123 or 456 rows, but the first and second rows of data
count = var _t = ADDCOLUMNS('Table',"count",RANKX(FILTER(ALL('Table'),[Reference Nr.]=EARLIER([Reference Nr.])),[Index],,ASC,Dense))
return SUMX(_t,[count])
For one = CALCULATE(MAX('Table'[Value]),FILTER('Table','Table'[count]=1))
For two = CALCULATE(MAX('Table'[Value]),FILTER('Table','Table'[count]=2))
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @azaterol ,
You can do this by creating measures (but it is not best solution when you have a lot of accounts and you would like to show all as columns):
Value (123) = CALCULATE(SUM('Table'[Value]), KEEPFILTERS('Table'[Account] = 123))
Value (456) = CALCULATE(SUM('Table'[Value]), KEEPFILTERS('Table'[Account] = 456))
Or better one - use matrix and one measure:
Sum of Value = Sum('Table'[Value])
Question - what happen if you have more than one value per Account - should then be a sum or average or max?
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
86 | |
84 | |
66 | |
61 | |
59 |
User | Count |
---|---|
194 | |
111 | |
105 | |
79 | |
71 |