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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
archerjayden
Helper I
Helper I

Dynamically Show Completed Months and Current Months' Finished Weeks in one Bar Chart

Hi Experts,

I would need your help with DAX on achieving my requirements

So I have two scenarios to meet. My data consists of Cost per hour and I have slicers Mfg Code,Dates(Year,Month and Week) on Bar Chart

CostRate : CALCULATE(Sum(cost)/Sum(hours_weekly))

  1. When I select specific Mfg Codes, I should be able to pass correspondent value for hours in the denominator.Something like this and I know I am wrong with this DAX, Just wanted to express what I mean daxically CostRate : If(SelectedValue(MfgCode="H"),CALCULATE(Sum(cost)/Calculate(Sum(hours_weekly),Filter(MfgCode = "H"),If(SelectedValue(MfgCode="L"),CALCULATE(Sum(cost)/Calculate(Sum(hours_weekly),Filter(MfgCode = "L"))

  2. I need to show months(past) and weeks(current months') display of data within Same Chart like this below(excel image)RateSample.JPGAs of now, I have made two charts Months and Weeks separate and used flags to filter only completed period/week
    Completed Months = if(FiscalDate[Year]= YEAR(Now()) && FiscalDate[Period]=Month(Now()) && FiscalDate[WeekOfYear] >min(FiscalDate[WeekOfYear]) && FiscalDate[WeekOfYear] <WEEKNUM(Now()),1,0)
    Completed Weeks = if(FiscalDate[Year]= YEAR(Now()) && FiscalDate[Period]=Month(Now()) && FiscalDate[WeekOfYear] >min(FiscalDate[WeekOfYear]) && FiscalDate[WeekOfYear] <WEEKNUM(Now()),1,0)Thanks in Advance
    ANS

0 REPLIES 0

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.