Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
srlabhe123
Post Patron
Post Patron

Changing visual in crosstab

Hi ALL,

 

I have below vdata coming from query

 Visual1.JPG

 

Now I want above visual to be changed to like below, I have tried using matrix but it doesnt gives me exact same visual.

 

Visual2.JPG

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @srlabhe123

 

 

Theres is a similar request on this post and if you go to the exceleratorbi link on that message you have the explanation on how to achieve a measure in rows.

 

I pick up your data and using the solution above work out this final result, see below the step by step and also a download for a pbix sample:

 

1 - Create a new table:

Measures Selection

ID | Measure

1   | Lines

2  | Order

 

2 - Create a measure on the Measures Selection table:

Selected_Measure = MAX('Measure Selection'[ID])

3 - Create 4 measures on the Fact_Table (name given to the basic data table):

Total Order = SUM(Vdata[Total Orders])

Total Line = SUM(Vdata[Total Lines])
Matrix_values =
SWITCH (
[Selected_Measure];
1 ; [Total Line] ;
2 ; [Total Order]
)

4 - Create a column on Vdata  with the following code

WeekDay =
SWITCH (
    WEEKDAY ( Vdata[Delivery_Date] );
    1; "Sun";
    2; "Mon";
    3; "TUE";
    4; "WED";
    5; "THU";
    6; "FRI";
    7; "SAT"
)

5 - Add the values to your visual matrix as explained:

Rows: Measure (column Measure Selection)

Columns: Delivery Date (column Vdata) + WeekDay (Column VData)

Values: Matrix_values (measure from VData)

 

6- Configure you Matrix to have the totals only for delivery date and not for week day

 

 

Final result:

 

ddd.png

 

See attach the PBIX file.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @srlabhe123

 

 

Theres is a similar request on this post and if you go to the exceleratorbi link on that message you have the explanation on how to achieve a measure in rows.

 

I pick up your data and using the solution above work out this final result, see below the step by step and also a download for a pbix sample:

 

1 - Create a new table:

Measures Selection

ID | Measure

1   | Lines

2  | Order

 

2 - Create a measure on the Measures Selection table:

Selected_Measure = MAX('Measure Selection'[ID])

3 - Create 4 measures on the Fact_Table (name given to the basic data table):

Total Order = SUM(Vdata[Total Orders])

Total Line = SUM(Vdata[Total Lines])
Matrix_values =
SWITCH (
[Selected_Measure];
1 ; [Total Line] ;
2 ; [Total Order]
)

4 - Create a column on Vdata  with the following code

WeekDay =
SWITCH (
    WEEKDAY ( Vdata[Delivery_Date] );
    1; "Sun";
    2; "Mon";
    3; "TUE";
    4; "WED";
    5; "THU";
    6; "FRI";
    7; "SAT"
)

5 - Add the values to your visual matrix as explained:

Rows: Measure (column Measure Selection)

Columns: Delivery Date (column Vdata) + WeekDay (Column VData)

Values: Matrix_values (measure from VData)

 

6- Configure you Matrix to have the totals only for delivery date and not for week day

 

 

Final result:

 

ddd.png

 

See attach the PBIX file.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.