Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello!
I am looking to create a bar chart with a date across the x-axis and then awarded/target values as the two bars (per year). I need to be able to drill down into each year at least to the Quarter.
Table 1 contains site, award date, and award value while table 2 contains site, target year, and target value. Summarizing the awarded value in table 1 by year is easy enough in a measure but I'm having trouble incorporating the table 2 data. For the target values, it would be by year, so there needs to be a sum of the target value of all sites by year (in other words, the target value for 2021 is site A + site B + site C + site D, or 2000 and the same thing for 2022, and 2023).
The result would look something like this:
Here's some sample data:
Thank you!
Solved! Go to Solution.
Hi @JLambs20 ,
Here are the steps you can follow:
1. Create a GroupTable with Enter data.
2. Create calculated Date_Table.
Date_Table =
CALENDAR(DATE(2021,1,1),DATE(2024,12,31))
3. Create measure.
Measure =
CALCULATE( SUM('Table1'[Award Value]),FILTER(ALL('Table1'),'Table1'[Award Date]>=MIN('Date_Table'[Date])&&'Table1'[Award Date]<=MAX('Date_Table'[Date])))
Measure1 =
CALCULATE( SUM('Table2'[Target Value]),FILTER(ALL(Table2),'Table2'[Year]>=YEAR(MIN('Date_Table'[Date]))&&'Table2'[Year]<=YEAR(MAX('Date_Table'[Date]))))
Flag=
SWITCH(
TRUE(),
MAX('GoupTable'[Group])="Actual Revenue",[Measure],
MAX('GoupTable'[Group])="Target Revenue",[Measure1])
4. Result:
When the X axis is Year:
When Dill down:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @JLambs20 ,
Here are the steps you can follow:
1. Create a GroupTable with Enter data.
2. Create calculated Date_Table.
Date_Table =
CALENDAR(DATE(2021,1,1),DATE(2024,12,31))
3. Create measure.
Measure =
CALCULATE( SUM('Table1'[Award Value]),FILTER(ALL('Table1'),'Table1'[Award Date]>=MIN('Date_Table'[Date])&&'Table1'[Award Date]<=MAX('Date_Table'[Date])))
Measure1 =
CALCULATE( SUM('Table2'[Target Value]),FILTER(ALL(Table2),'Table2'[Year]>=YEAR(MIN('Date_Table'[Date]))&&'Table2'[Year]<=YEAR(MAX('Date_Table'[Date]))))
Flag=
SWITCH(
TRUE(),
MAX('GoupTable'[Group])="Actual Revenue",[Measure],
MAX('GoupTable'[Group])="Target Revenue",[Measure1])
4. Result:
When the X axis is Year:
When Dill down:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi,
Share the link from where i can download your PBI file.
This works when set up the way you mentioned, however, it doesn't allow me to drill down on the award date since we're using the distinct year as the x-axis. Once we've figured that out, I'll be good to go!
Hello, @JLambs20 !
I did it this way:
1. Create table with distinct years (DimYear)
2 Create table YearlyAwarded
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
84 | |
69 | |
68 | |
39 | |
37 |