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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
GX_1
Frequent Visitor

Filtering measure by specific variables

Hi Everyone! 

 

Goal: Filter data by ID, Year, Month for each result.

 

Currently its filtering by ID then aggregating all the years (2020-2021) that fall into the same ID group for the numerator (all Actual) and similar for denominator (all Targets). 

 

https://drive.google.com/drive/folders/1PzbQYPLJXo7ywVjNxjbjxHOfstBG_FOO?usp=sharing

 

Any thoughts would be amazing, thanks!

 

 

3 REPLIES 3
v-kkf-msft
Community Support
Community Support

Hi @GX_1 ,

 

Does your problem have been solved? If it is solved, please mark a reply which is helpful to you.

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

 

Best Regards,
Winniz

v-kkf-msft
Community Support
Community Support

Hi @GX_1 ,

Try to modify measure Result:

Result = 
VAR _Cost =
    SELECTEDVALUE ( 'Table'[Cost] )
VAR _act = [Actual]
VAR _forc = [Forecast]
VAR _targ = [Approved Target]
VAR _att = 
    IF (
        ISBLANK ( _act ),
        IF ( _Cost = "Forecast",  _forc/ _targ  - 1 ),
        IF ( _Cost = "Actual",  _act/ _targ  - 1 )
    )
RETURN
    _att

 

Or create a new measure:

Measure = 
CALCULATE(
    SUM('Table'[value]),
    FILTER(
        'Table',
        'Table'[Cost] = "Actual"
        || 'Table'[Cost] = "Forecast"
    )
) /
CALCULATE(
    SUM('Table'[value]),
    FILTER(
        'Table',
        'Table'[Cost] = "Approved Target"
    )
) - 1

image.png

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

Fowmy
Super User
Super User

@GX_1 

Can you share some sample data and the expected result to have a clear understanding of your question?
You can save your files in OneDrive, Google Drive, or any other cloud sharing platform and share the link here.
____________________________________
How to paste sample data with your question?
How to get your questions answered quickly?

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.