Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
Who can help me to find a solution for my problem.
I've a table with the following content:
| Account Name | Product Name | PRIO |
| Test | Test_1 | 1 |
| Test | Test_2 | 2 |
| Test | Test_4 | 4 |
| List | Test_2 | 2 |
| SOFTWARE | Test_15 | 5 |
| SOFTWARE | Test_16 | 4 |
In a another table or if possible directly in 2 graphs I would like to have following output:
Solution -->
| PRIO/ | 1 | 2 | 3 | 4 | 5 |
| Accounts | 0 | 1 | 0 | 1 | 1 |
| Producten | 0 | 1 | 0 | 3 | 2 |
Thanks a lot!
Stephanie
Solved! Go to Solution.
OK, here we go. My base data table is Table2. Create a disconnected table with a [Name] column with two rows, "Accounts" and "Products". This is Table3 in my example. Now create the following measure:
Measure =
VAR __maxPrio = MAX([PRIO])
VAR __tableAccounts = SUMMARIZE(ALL('Table2'),[Account Name],"__prio",MAX([PRIO]),"__products",COUNT([Product Name]))
VAR __countAccounts = COUNTX(FILTER(__tableAccounts,[__prio]=__maxPrio),[Account Name])
VAR __countProducts = SUMX(FILTER(__tableAccounts,[__prio]=__maxPrio),[__products])
RETURN
SWITCH(
TRUE(),
MAX('Table3'[Name])="Accounts",__countAccounts,
MAX('Table3'[Name])="Products",__countProducts
)
Now create a matrix visualization with 'Table3'[Name] as the Rows, 'Table2'[PRIO] as the Columns and [Measure] as the Values.
OK, here we go. My base data table is Table2. Create a disconnected table with a [Name] column with two rows, "Accounts" and "Products". This is Table3 in my example. Now create the following measure:
Measure =
VAR __maxPrio = MAX([PRIO])
VAR __tableAccounts = SUMMARIZE(ALL('Table2'),[Account Name],"__prio",MAX([PRIO]),"__products",COUNT([Product Name]))
VAR __countAccounts = COUNTX(FILTER(__tableAccounts,[__prio]=__maxPrio),[Account Name])
VAR __countProducts = SUMX(FILTER(__tableAccounts,[__prio]=__maxPrio),[__products])
RETURN
SWITCH(
TRUE(),
MAX('Table3'[Name])="Accounts",__countAccounts,
MAX('Table3'[Name])="Products",__countProducts
)
Now create a matrix visualization with 'Table3'[Name] as the Rows, 'Table2'[PRIO] as the Columns and [Measure] as the Values.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 37 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |