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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
BI_Vijay
Regular Visitor

Need help with a DAX formula

I have 2 measures

one is Transactions - which is nothing but the Sum(Transactions) from my Fact 'Debit Transaction' and the other one is

 'Sector Transactions' - which actually should show the value for the whole sector of a customer.

 

The measure is written in this way

 

Sector Transactions =
VAR SelectedSector = SELECTEDVALUE(Customer[Sector Name])
VAR Output1 =
    IF(
        ISBLANK(SelectedSector),
        BLANK(),
        CALCULATE(
            SUM('Debit Transaction'[Transactions]),
            FILTER(
                ALL(Customer), Customer[Sector Name]=SelectedSector
            )
        )
    )
RETURN Output1
 
 
This acutally works well. 
BI_Vijay_0-1728656083083.png

 

Now, if i take one more column from an another dimension then it just starts to show all the records from the other dimensions. 

 

For example: the other dimension is called - Contract and the column is called "Commercial Name" then it just shows all the values or records from the Contract Dimension. like this,

 

BI_Vijay_1-1728656097274.png

 

 But, the expected ourcome is, 

 

BI_Vijay_2-1728656110730.png

 

I basically want the CommercialName of the customer along witht the values to the measures but not all the commercialnames from the dimension

can someone help on this?

 

 

Thanks,

Vijay

6 REPLIES 6
_AAndrade
Super User
Super User

Hi @BI_Vijay,

Please try this formula:

Sector Transactions =
VAR SelectedSector = SELECTEDVALUE(Customer[Sector Name])
VAR Output1 =
    IF(
        ISBLANK(SelectedSector),
        BLANK(),
        CALCULATE(
            SUM('Debit Transaction'[Transactions]),
            REMOVEFILTERS(Customer[Main Sector Name])  
        )
    )
RETURN Output1




Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Thanks @_AAndrade . I tried that, and it removed the filter on the Main Sector which is equivalent to the other measure "Transactions". 

This is how the output looks like

BI_Vijay_0-1728656949117.png

 

 

 

Could you please share a pbix file with an example of your data and data model?





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Hey @_AAndrade , sorry i had other measures too in the visual which actually made the visuals to go wrong. I tried the same DAX from you again and i see the results are closer to what i want.

BI_Vijay_0-1728659351149.png

 

and unfortunately, the PBIX has lot of PROD Tables - actually, 15 more which i haven't mentioned here - but they are perfectly connected.

So, i'm trying to replicate the outputs in excel and posting it here.

 

Thank you!

Hi,

Share the download link of the PBI file.


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

Hi @BI_Vijay , hello,_AAndrade, thank you for your prompt reply!
 

The core issue arises from a shift in the metric’s context.

Please try the following measure to  compare the result:

Sector Transactions =
VAR SelectedSector = SELECTEDVALUE(Customer[Sector Name])
VAR Output1 =
    IF(
        ISBLANK(SelectedSector),
        BLANK(),
        CALCULATE(
            SUM('Debit Transaction'[Transactions]),
            FILTER(
                ALL(Customer),
                Customer[Sector Name] = SelectedSector
            ),
            FILTER(
                VALUES(Contract[Commercial Name]),
                SUM('Debit Transaction'[Transactions]) > 0 
            )
        )
    )
RETURN Output1

If the issue persists, please upload your sample table data include your relationships for further troubleshooting.

Best regards,

Joyce

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




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors