Forum Discussion
Creating a Dynamic Matrix Based on Column Names in Every Table
- 5 years ago
Hi, taylorb
According to your description, I guess you want to get a table that displays the [CustomerSource] column in the five tables, and the value should be the user who views this report. I think you can not achieve this in a simple DAX, you can create measures for each table to get the expected result, you can take a look at my steps:
- Create the five measures in five tables (one by one):
Table1 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table1',[CustomerSource]=USERPRINCIPALNAME())) Table2 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table2',[CustomerSource]=USERPRINCIPALNAME())) Table3 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table3',[CustomerSource]=USERPRINCIPALNAME())) Table4 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table4',[CustomerSource]=USERPRINCIPALNAME())) Table5 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table5',[CustomerSource]=USERPRINCIPALNAME()))- Create a table chart and place them into it, and view as a username, you can get what you want, like this:
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, taylorb
According to your description, I guess you want to get a table that displays the [CustomerSource] column in the five tables, and the value should be the user who views this report. I think you can not achieve this in a simple DAX, you can create measures for each table to get the expected result, you can take a look at my steps:
- Create the five measures in five tables (one by one):
Table1 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table1',[CustomerSource]=USERPRINCIPALNAME()))
Table2 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table2',[CustomerSource]=USERPRINCIPALNAME()))
Table3 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table3',[CustomerSource]=USERPRINCIPALNAME()))
Table4 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table4',[CustomerSource]=USERPRINCIPALNAME()))
Table5 = CALCULATE(MAX('Table1'[CustomerSource]),FILTER('Table5',[CustomerSource]=USERPRINCIPALNAME()))
- Create a table chart and place them into it, and view as a username, you can get what you want, like this:
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- taylorb5 years agoHelper I
This looks great, thank you