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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
GianlucaM
Helper II
Helper II

wrong summarization of measures

 

MeseRank index.Zona CommittenteBusinessValoreKindFirst CharactersCustomMonthProduct hierarchy
GIUGNOVENDITE S/C ITALIASENSORI (SENSORS)€ 1.520.000,00F'CST -0Jun2301-Jun-23SC12SE30507
AGOSTOVENDITE S/C ITALIASENSORI (SENSORS)€ 650.000,00F'CST -1Aug2301-Aug-23SC12SE30507
GIUGNOVENDITE S/C ITALIASENSORI (SENSORS)€ 1.560.000,00F'CST -1Jun2301-Jun-23SC12SE30507
SETTEMBREVENDITE S/C ITALIASENSORI (SENSORS)€ 1.650.000,00F'CST -2Sep2301-Sep-23SC12SE30507
AGOSTOVENDITE S/C ITALIASENSORI (SENSORS)€ 525.000,00F'CST -2Aug2301-Aug-23SC12SE30507
GIUGNOVENDITE S/C ITALIASENSORI (SENSORS)€ 1.560.000,00F'CST -2Jun2301-Jun-23SC12SE30507
         
         
         

Hi,

 

i'm working on a table where I have to collect different version of a forecast and store just the last updated, which, on a rolling month base, is suppose to be updated .

To do this i've written this measure 

FCST* = var FCST0=calculate(sum(FCST[Valore]),FCST[Kind]="F'CST 0")
        var FCST1=calculate(sum(FCST[Valore]),FCST[Kind]="F'CST -1")
        var FCST2=calculate(sum(FCST[Valore]),FCST[Kind]="F'CST -2")
    return
    if(not(ISBLANK(FCST0)),FCST0,
                                if(not(isblank(FCST1)),FCST1,
                                                            if(not(isblank(FCST2)),FCST2,0)))

The issue is that this is not able to correctly summarize at a quarter level as, if a month doesn't have the latest relaease of the forecast it doesn't consider the FCST-1 as alternative value to be consider.

in the database I have actually just the FCST0 over July but not for Aug and Sept.
On a  months bases the measure works fine, but on an agregate level, it doesn't as it just consider to sum the FCST 0

GianlucaM_0-1689677411482.png

How can I re-write the measure to make it works on an agregate (quarterly) level? What I expect is to have a total of QTR 3 of 740+1301+1417


Thanks

2 ACCEPTED SOLUTIONS
v-tangjie-msft
Community Support
Community Support

Hi @GianlucaM ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a new measure. 

fact_ = var _a=SUMX(VALUES('FCST'[Month]),[FCST*])
return
IF(_a = BLANK(),0,_a)

(3) Then the result is as follows.

vtangjiemsft_0-1689822158145.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

View solution in original post

Thank you so much @v-tangjie-msft , very brilliant work around

View solution in original post

2 REPLIES 2
v-tangjie-msft
Community Support
Community Support

Hi @GianlucaM ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a new measure. 

fact_ = var _a=SUMX(VALUES('FCST'[Month]),[FCST*])
return
IF(_a = BLANK(),0,_a)

(3) Then the result is as follows.

vtangjiemsft_0-1689822158145.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Thank you so much @v-tangjie-msft , very brilliant work around

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.