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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
CostaM2018
Frequent Visitor

Mistery of Measure with no totals

I stuck with a measure that doesn't seem to sum totals at the end. If anyone can help me would be much appreciated. 
I have two measures that is used to create a third measure

 

BP Trxs # = IF(
SUM('Monthly Revenue Report'[Bill Payment # Trx]) = 0,
BLANK(),
SUM('Monthly Revenue Report'[Bill Payment # Trx]))

BP Trxs # LY = CALCULATE([BP Trxs #], SAMEPERIODLASTYEAR('dCalendar'[Date]))

LossOfBP# (before_billing) =
VAR CurrentYearTRX = [BP Trxs #]
VAR PrevYearTRX = [BP Trxs # LY]
RETURN
IF (
ISBLANK(CurrentYearTRX) && NOT(ISBLANK(PrevYearTRX)),
PrevYearTRX, -- Return the value of the measure directly
BLANK()
)

ISSUE:
measure does a good job indentifying the Loss per customer_number but total is always blank. 

CostaM2018_0-1726086952998.pngCostaM2018_1-1726086967284.png


"LossOfBP# (before_billing)" should sum at the bottom for each column

CostaM2018_2-1726087017051.png

sample
Fiscal Year and Fiscal Month is coming form Calendar table [Date]

Fiscal YearFiscal Monthcustomer_numberBP Trxs # LYBP Trxs #LossOfBP# (before_billing)
20255a196105 
20255a258 
20255a3221209 
20255a41721 
20255a53 3
20255a6 8 
20255a743 
20255a8711 
20256a159 59
20256a25738 
20256a34037 
20256a4717 
20256a51715 
20256a6811 
20256a75923 
20256a889 
20257a13626 
20257a254 
20257a31 1
20257a43814 
20257a5126115 
20257a66 6
20257a721 
20257a81216 
20257a9 12 
20258a137 
20258a21824 
20258a31 1
20258a41012 
20258a5136 
20258a622 
20258a775 
20258a82115 
20258a94874 
20258a105358 
20258a11 3 
20258a1211 
20258a1343 
20258a1416 16



 

1 ACCEPTED SOLUTION

Hello @Ashish_Mathur 

I was able to make it work. I wrote the dax as follows:

BP#Loss =
SUMX(
    FILTER(
        VALUES('tbl_customer (2)'[customer_number]),
        ISBLANK([BP Trxs #]) && NOT(ISBLANK([BP Trxs # LY]))
    ),
    [BP Trxs # LY]
)

this sums the subtotal and totals of the result of conditionals. 

Thanks 
M

View solution in original post

5 REPLIES 5
DataInsights
Super User
Super User

@CostaM2018,

 

Try wrapping your measure in SUMX using the dimensions in your visual. Example:

 

LossOfBP# (before_billing) =
SUMX (
    SUMMARIZE ( dCalendar, dCalendar[Fiscal Year], dCalendar[Fiscal Month] ),
    VAR CurrentYearTRX = [BP Trxs #]
    VAR PrevYearTRX = [BP Trxs # LY]
    RETURN
        IF (
            ISBLANK ( CurrentYearTRX ) && NOT ( ISBLANK ( PrevYearTRX ) ),
            PrevYearTRX, -- Return the value of the measure directly
            BLANK ()
        )
)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hello, thank you for helping to sort this up with me. I tried to adjust the dax but I am having the same issue. I believe breaking my tables up would help you to understand what might be happening and maybe guide me to a different route. 

My intent with the dax is to use current Fiscal year qty transactions vs last Fiscal year qty Transactions to define loss in transactions per customer_number in current year. 

Conditional is something like:
In case the "current Fiscal" = Blank or null and "Last Fiscal" <> Blank or null, then "Last Fiscal", else Blank().

I was trying to do this with the dax but I bet there is something wrong in the way. 

here is a breakdown of
my tables:
table1: Monthly Revenue Report

PeriodEndcustomer_numberBill Payment # Trx
2024-05-31a1105
2024-05-31a28
2024-05-31a3209
2024-05-31a421
2024-05-31a5 
2024-05-31a68
2024-05-31a73
2024-05-31a811
2024-06-30a1 
2024-06-30a238
2024-06-30a337
2024-06-30a417
2024-06-30a515
2024-06-30a611
2024-06-30a723
2024-06-30a89
2024-07-31a126
2024-07-31a24
2024-07-31a3 
2024-07-31a414
2024-07-31a5115
2024-07-31a6 
2024-07-31a71
2024-07-31a816
2024-07-31a912
2024-08-31a17
2024-08-31a224
2024-08-31a3 
2024-08-31a412
2024-08-31a56
2024-08-31a62
2024-08-31a75
2024-08-31a815
2024-08-31a974
2024-08-31a1058
2024-08-31a113
2024-08-31a121
2024-08-31a133
2024-08-31a14 
2023-05-31a196
2023-05-31a25
2023-05-31a3221
2023-05-31a417
2023-05-31a53
2023-05-31a6 
2023-05-31a74
2023-05-31a87
2023-06-30a159
2023-06-30a257
2023-06-30a340
2023-06-30a47
2023-06-30a517
2023-06-30a68
2023-06-30a759
2023-06-30a88
2023-07-31a136
2023-07-31a25
2023-07-31a31
2023-07-31a438
2023-07-31a5126
2023-07-31a66
2023-07-31a72
2023-07-31a812
2023-07-31a9 
2023-08-31a13
2023-08-31a218
2023-08-31a31
2023-08-31a410
2023-08-31a513
2023-08-31a62
2023-08-31a77
2023-08-31a821
2023-08-31a948
2023-08-31a1053
2023-08-31a11 
2023-08-31a121
2023-08-31a134
2023-08-31a1416



table2: dcalendar

DateFiscal YearFiscal Month Sort OrderFiscal Month
2023-05-3120241May
2023-06-3020242Jun
2023-07-3120243Jul
2023-08-3120244Aug
2023-09-3020245Sep
2023-10-3120246Oct
2023-11-3020247Nov
2023-12-3120248Dec
2024-01-3120249Jan
2024-02-29202410Feb
2024-03-29202411Mar
2024-04-30202412Apr
2024-05-3120251May
2024-06-3020252Jun
2024-07-3120253Jul
2024-08-3120254Aug
2024-09-3020255Sep


table 3: customer

customer_number
a1
a2
a3
a4
a5
a6
a7
a8
a9
a10
a11
a12
a13
a14

Hi,

Share the download link of the PBI file.


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

I have a pbix I can share. I dont have onedrive or any place I can drop the file. how can I send it to you? by email maybe?

Hello @Ashish_Mathur 

I was able to make it work. I wrote the dax as follows:

BP#Loss =
SUMX(
    FILTER(
        VALUES('tbl_customer (2)'[customer_number]),
        ISBLANK([BP Trxs #]) && NOT(ISBLANK([BP Trxs # LY]))
    ),
    [BP Trxs # LY]
)

this sums the subtotal and totals of the result of conditionals. 

Thanks 
M

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 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.

Sept NL Carousel

Fabric Community Update - September 2024

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