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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Selded
Helper III
Helper III

Bar Chart Help

Is there a visual in Power BI that I can use to achieve the below report that I have prepared in excel?

 

Daily, WTD and average

 

Selded_0-1633956125471.png

Thanks 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @Selded ,

 

First create a column in your fact table:

Month-day = FORMAT('Table'[date],"DD-MMM-YY")

Then create a dim table as below:

Table 2 = UNION(VALUES('Table'[Month-day]),ROW("name","WTD actual"),ROW("name","WTD Target"))

And a date table as below:

Date = CALENDAR("2021-1-1","2021-12-31")

Then create a measure as below:

Measure =
VAR _mindate =
    MINX ( ALLSELECTED ( 'Table' ), 'Table'[date] )
RETURN
    SWITCH (
        SELECTEDVALUE ( 'Table 2'[Month-day] ),
        "WTD actual",
            CALCULATE (
                SUM ( 'Table'[amount] ),
                FILTER (
                    ALLSELECTED ( 'Table' ),
                    'Table'[date] >= _mindate
                        && 'Table'[date] <= _mindate + 6
                )
            ),
        "WTD Target", 375466,
        SUM ( 'Table'[amount] )
    )

And you will see:

vkellymsft_0-1634191890161.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

View solution in original post

4 REPLIES 4
v-kelly-msft
Community Support
Community Support

Hi  @Selded ,

 

First create a column in your fact table:

Month-day = FORMAT('Table'[date],"DD-MMM-YY")

Then create a dim table as below:

Table 2 = UNION(VALUES('Table'[Month-day]),ROW("name","WTD actual"),ROW("name","WTD Target"))

And a date table as below:

Date = CALENDAR("2021-1-1","2021-12-31")

Then create a measure as below:

Measure =
VAR _mindate =
    MINX ( ALLSELECTED ( 'Table' ), 'Table'[date] )
RETURN
    SWITCH (
        SELECTEDVALUE ( 'Table 2'[Month-day] ),
        "WTD actual",
            CALCULATE (
                SUM ( 'Table'[amount] ),
                FILTER (
                    ALLSELECTED ( 'Table' ),
                    'Table'[date] >= _mindate
                        && 'Table'[date] <= _mindate + 6
                )
            ),
        "WTD Target", 375466,
        SUM ( 'Table'[amount] )
    )

And you will see:

vkellymsft_0-1634191890161.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

Pragati11
Super User
Super User

HI @Selded ,

 

You can use a Line and Clustered Column chart in Power BI to represent 2 metrics with common x-axis.

Something like below:

Pragati11_0-1633958200574.png

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

okay, so is impossible to have the WTD, daily, and average all on the same chart right

HI @Selded ,

 

In what format your data is, it depends on that as well.

Can you share some sample data here?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.