Reply
Highlighted
Member
Posts: 52
Registered: ‎03-16-2018
Accepted Solution

Switch MTD & YTD visualizing multiple variables

Hi,

 

I have data for monthly 'Spend amount','Savings amount' and Savings %. The last one is savings amount divided by spend amount. I calculated MTD & YTD figures for all 3 variables. Then I build a slicer table for the switch MTD & YTD. What I want is to present MTD figures for each month and all 3 variables in a table when the user selects MTD. When YTD is selected this should switch to YTD figures. Second I want a graph showing the MTD or YTD savings amount for all months (dependend on the switch MTD / YTD) and the savings % MTD or YTD. This is what I already have. Till now data is only available for January 2019.

 

Purchasing_spend_and_savings - Power BI Desktop_2019-02-15_13-21-06.png

 

I tried to work with an extra table and Switch key, but that did not work unfortunately. But I am convinced the solution should be found there somehow.

 

Purchasing_spend_and_savings - Power BI Desktop_2019-02-15_13-28-16.png

 

Thanks for your help in advance.

 

 

 


Accepted Solutions
Member
Posts: 52
Registered: ‎03-16-2018

Re: Switch MTD & YTD visualizing multiple variables

Maybe there is another solution, but I already solved it myself building 3 separate measure selections and putting them in the table or graph.

 

Measure_Selection_Savings =
SWITCH( TRUE(),
    VALUES(Slicer_table_savings[Time Cut]) = "MTD", [MTD_savings],
    VALUES(Slicer_table_savings[Time Cut]) = "YTD", [YTD_savings],
    BLANK())
 
Measure_Selection_Spend =
SWITCH( TRUE(),
    VALUES(Slicer_table_savings[Time Cut]) = "MTD", [MTD_Spend],
    VALUES(Slicer_table_savings[Time Cut]) = "YTD", [YTD_Spend],
    BLANK())
 
Measure_Selection_Savings % =
SWITCH( TRUE(),
    VALUES(Slicer_table_savings[Time Cut]) = "MTD", [MTD_Savings %],
    VALUES(Slicer_table_savings[Time Cut]) = "YTD", [YTD_savings %],
    BLANK())

View solution in original post

Community Support Team
Posts: 3,195
Registered: ‎02-06-2018

Re: Switch MTD & YTD visualizing multiple variables

Hi  @Hyperchef1969 ,

 

It seems that you have solved by yourself.

 

Please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post


All Replies
Member
Posts: 52
Registered: ‎03-16-2018

Re: Switch MTD & YTD visualizing multiple variables

Maybe there is another solution, but I already solved it myself building 3 separate measure selections and putting them in the table or graph.

 

Measure_Selection_Savings =
SWITCH( TRUE(),
    VALUES(Slicer_table_savings[Time Cut]) = "MTD", [MTD_savings],
    VALUES(Slicer_table_savings[Time Cut]) = "YTD", [YTD_savings],
    BLANK())
 
Measure_Selection_Spend =
SWITCH( TRUE(),
    VALUES(Slicer_table_savings[Time Cut]) = "MTD", [MTD_Spend],
    VALUES(Slicer_table_savings[Time Cut]) = "YTD", [YTD_Spend],
    BLANK())
 
Measure_Selection_Savings % =
SWITCH( TRUE(),
    VALUES(Slicer_table_savings[Time Cut]) = "MTD", [MTD_Savings %],
    VALUES(Slicer_table_savings[Time Cut]) = "YTD", [YTD_savings %],
    BLANK())
Community Support Team
Posts: 3,195
Registered: ‎02-06-2018

Re: Switch MTD & YTD visualizing multiple variables

Hi  @Hyperchef1969 ,

 

It seems that you have solved by yourself.

 

Please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.