Forum Discussion

icassiem's avatar
icassiem
Post Prodigy
2 years ago

Graph Custom X & Y Measures

Good day,

 

I would like to build a Custom KPI grouped visual, a scilcer that customizes the x/y grain (day, week, month...) of graph pending slcier selection

KPI = 2 visuals that groups a Card Value and an Line Graph

2 Slciers - 1 normal date slicer, 1 graph grain (day, week, month, qtr, year) 

 

1. how to build a custom x-measure that calculates & displays based on the grain selected (day, week, month...) ? 

2. how to build a custum y-measure that calculates & displays based on the grain selected (day, week, month...) ? 

3. the KPI value card to calculate based on the garin selected (but im thinking this should not matter as its a value and the date range selected calculates the value) please verify?

4. Nice to have, the grain slicer, in long term to be altered to image buttons for day, week, month to replace the drop down slicer

 

Please 1-3 is key, kindly help and provide some examples?

 

Thank You

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi icassiem ,

     

    You can create a measurement that calculates the X-axis based on the selected grain. Use the SWITCH function to dynamically switch between days, weeks, months, etc.

    Try like below:

    X-Measure = SWITCH(
        SELECTEDVALUE('GrainSelection'[SelectedGrain]),
        "Day", MAX(DateTable[Date]),
        "Week", WEEKNUM(MAX(DateTable[Date])),
        "Month", MONTH(MAX(DateTable[Date])
    )
    )

     

    If problems persist, please provide some test data and screenshots of desired results.

     

    Best Regards,
    Adamk Kong

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • icassiem's avatar
      icassiem
      Post Prodigy

      Thank You for assisting

      Custom X using the switch - it will be grain calculated for a date range by grain in x-axis of graph? 

      Custom Y using the switch - need the measure to claculate at the grain level ofver the dat range the x-axis shows?

       

      Please help with an example:

      MeasureX = Siwtch as its the grain Y will be calculated on

      MeasureY = value/qty > how would i add the switch to th grain if the calculation

      Sorry only starting next week, so dont have actual examples

      kpi valu, does not include the custom measure but daerange only correct?

       

      please help

    • icassiem's avatar
      icassiem
      Post Prodigy

      Hi,

       

      Still battling, my x-axis is the calendar master field of what level, how would my calculated column look in calendar master?

      the Y-Axis should be calculated based on the level the x-axis selected grain?

      please help

  • 1. A custom-x-axis measure that pending slicer selection alters the grain of the custom measure-x-axis?

    2. Does the slicer selection also need to be part of the custom-y-axis selection?

     

    Please anyone help with links/examples?