cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GhadaMehrez
Helper III
Helper III

Measure Filter

Currently, I have a dashboard, which contains the below fields:

 

1- Estimated Total Cost (%) >>>> this is custom measure

2- Actuals Cost (%)>>>> this is custom measure

1- Estimated Total Cost ($) >>>> this is custom measure

2- Actuals Cost ($) >>>> this is custom measure

 

I succeeded to build the first row for total and for Strategy Categories.

the error here in the second section I need to filter the fields based on duration (Short-Mid-Long).

first I created a measure to calculate the difference between the Start and End Date of projects to give me No. of the month in order to allow me to calculate duration as:

Short Term (0-1 Year)

Mid Term (1-2 years)

Long Term (Above 2 years)

here is the measure expression:

No.of months = SUMX(Projects, DATEDIFF(Projects[fls_actualstartdate],Projects[fls_actualenddate],month))

 

Second I have card visual as 1st section to set the values but cards not allow filter measure as below screen:

Any help how to accomplish this task please??

 

GhadaMehrez_0-1660240517815.png

 

GhadaMehrez_1-1660240673976.png

 

2 REPLIES 2
v-rzhou-msft
Community Support
Community Support

Hi @GhadaMehrez ,

 

I suggest you to add a duraction flag column in 'Product' table.

Duration Flag =
SWITCH (
    TRUE (),
    [No.of months] <= 12, "Short Term",
    [No.of months] <= 24, "Mid Term",
    "Long Term"
)

Then you can filter your measure by the slicer which is built based on this calcualted column.

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

thanks a lot for your help but I don't have permission to add column so I added {duration} measure as you suggested but I still cannot filter card visuals by Duration measure :

GhadaMehrez_0-1660639704961.png

 

I have another idea maybe I need to update this measure by adding filter by duration, could you help me in this:

 

 

% ETC V3 =
DIVIDE(
[ETC This Year],
CALCULATE(
Sumx(FILTER(Projects, [fls_actualenddate], [fls_actualstartdate], [Duration Flag] Short Term),
ALL('Projects'[fls_StrategyThemeName]),
)
)

GhadaMehrez_1-1660639848698.png

 

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors