cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Variable values fields required in column chart

Hi,

I want to have variable value fields in column chart instead of fixing them. For example, I have overtime data of cost and hrs.

 

I want to create ONE single clustered column chart where month should be in x-axis (fixed) and in values area I want variable values.

Like if I click on a button / slicer for overtime cost, the column chart should give me cost and if I select overtime Hrs, i t should show Hrs.

ONE CHART FOR TWO FIELDS (COST & HRS)

 

Please see my sample data and advise.

https://www.dropbox.com/sh/1zrdlchzcfmwzcs/AADAvy5zk9ifpzzFnImEVHfEa?dl=0

Regards,

Imran

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi, @muhammadimran 

 

You may create a table and a measure as below.
Table:

b1.PNG

 

Measure:

Result = 
IF(
    ISFILTERED('Table'[Category]),
    IF(
        SELECTEDVALUE('Table'[Category])="Cost",
        SUM(Overtime[Overtime Cost]),
        IF(
            SELECTEDVALUE('Table'[Category])="Hrs",
            SUM('Overtime'[Overtime Hrs])
        )
    )
)

 

Result:

b2.PNG

b4.PNG

 

Best Regards

Allan

 

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

3 REPLIES 3
Highlighted
Super User IV
Super User IV

@muhammadimran , Refer if this can help

https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted

I saw the post you share but actually this is not the case I am looking for. I need to have;

fix "x-axis" -- that is month, and;

variable "y-axis" --that is either cost or Hrs

 

Both cost and hrs are two seprate columns of my table. What is the solution of this problem.

 

Regards,

Highlighted
Community Support
Community Support

Hi, @muhammadimran 

 

You may create a table and a measure as below.
Table:

b1.PNG

 

Measure:

Result = 
IF(
    ISFILTERED('Table'[Category]),
    IF(
        SELECTEDVALUE('Table'[Category])="Cost",
        SUM(Overtime[Overtime Cost]),
        IF(
            SELECTEDVALUE('Table'[Category])="Hrs",
            SUM('Overtime'[Overtime Hrs])
        )
    )
)

 

Result:

b2.PNG

b4.PNG

 

Best Regards

Allan

 

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors