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
wfeng
Regular Visitor

How to show comparing date in bar chart?

Hi everyone,

 

I am working on a simple data set, like that:

wfeng_0-1597254554539.png

When I put them in a bar chart, it will show like:

wfeng_1-1597254660379.png

My setting is:

wfeng_2-1597254717009.pngwfeng_3-1597254758446.png

However, what I want is like this:

wfeng_4-1597255374568.png

 

The issue is the date data was counted, but I cannot figure out how to discount it.

 

I will very much appreciate you if anyone can tell me how to do it. Thanks!

 

 

 

 

 

 

1 ACCEPTED SOLUTION

I would look through appSource visuals to see if something there meets your needs. Alternatively, you can trick an array into doing this by making a date table (unrelated to the data), a measure that compares the date with the completed/expected dates, and the conditional formatting in the background and font. See the following example, using the week column of a date table (you could use date, month, and so on) to get the result. It also uses the Show in Rows function of the array visual.

mahoneypat_0-1597410302576.png

The measures used above are (replace BarChart with the actual name of the table)

Esperado. • var mindate - MIN('Date'[Date])
return if(mindate<-MIN(BarChart[Expected]),1)
Completado. • var mindate - MIN('Date'[Date])
return if(mindate<-MIN(BarChart[Completed]),1)

If this works for you, mark it as the solution. Praise is also appreciated. Please let me know if you don't.

Best regards

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

10 REPLIES 10

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.