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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Hyperchef1969
Helper V
Helper V

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.

 

 

 

2 ACCEPTED SOLUTIONS
Hyperchef1969
Helper V
Helper V

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

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

2 REPLIES 2
Hyperchef1969
Helper V
Helper V

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())

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.