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
analyst312
Frequent Visitor

Need help with HASONEFILTER since the original measure isnt working

Working on a measure that calculated the month/month difference. I was able to pull one together that works but now the totals dont total correctly. Ive ran into this problem before but can never get the HASONEFILTER correct.

 

Here is the first measure:

 

Mo/Mo Diff =IF(CALCULATE(
    [Sum of Census],
    PARALLELPERIOD(
        'Calendar'[Dates],
        -1,
        MONTH)
) = BLANK(),

BLANK(),

[Sum of Census]-CALCULATE(
    [Sum of Census],
    PARALLELPERIOD(
        'Calendar'[Dates],
        -1,
        MONTH)
))

 

Second measure with the HASONEFILTER

 

 

Mo/Mo Diff FIX =IF(HASONEFILTER('Calendar'[Month]),
[Mo/Mo Diff],
SUMX(VALUES('Calendar'[Month]),
[Mo/Mo Diff]))

 

 

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @analyst312 ,

 

Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.

Best Regards
Lucien

amitchandak
Super User
Super User

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.