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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
myou
Helper II
Helper II

Get the LAST NON BLANK SCORE Per SubCategory, then AVG the result for the Category Level

Get Last Non Blank Score Per SubCategory then Average it all up

 

DataModel:

Data ModelData Model

In Measuress Table I have Score, I want to get the last non blank value per Subcategory

 

Capture123.JPG

I managed to get the last non blank value per subcategory, but when it comes to Category level the result becomes wrong

I am getting 33% while it should be 28%

 
DAX USed:

 

Measures_Score_AVG_Score =
CALCULATE (
    AVERAGE ( Measuress[Measure_Score] ),
    FILTER (
        Measuress,
        Measuress[EndDate]
            = CALCULATE (
                LASTNONBLANK ( Measuress[EndDate], TRUE () ),
                FILTER ( Measuress, Measuress[Measure_Actual] <> BLANK () )
            )
    )
)
​

 

powerbi.JPG

 

PBIX FILE : https://gofile.io/d/R2ABeq

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

28% is wrong.  The score for Toyota was on Jan 1, not on Feb 1, and should therefore not be considered.

lbendlin
Super User
Super User

33% is correct because the lastnonblank date for "Cars"  is Feb 1 20, and it has two values of .5 and .15, and the average of these is .325

Hi @lbendlin , I Want a formula to generate the 28%

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.