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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Pedro503
Resolver I
Resolver I

Showing ALL() values - but only when there are values in another columns

Hey there

 

Link for the file

 

Is there any way to show the rows in the following table but only when there is a value for the month in the filter context?

Untitled.png

 

The measure that calculates the Amount deducted is the following:

 

 

Amount deducted = 
VAR _ALL = CALCULATE( [Amount] , ALL( d_calendar ) ) -- , CALCULATETABLE( Example ) )
VAR _Result = 
    CALCULATE( 
        [Amount],
        FILTER(
            ALL( d_calendar ),
            d_calendar[Date] <= MAX( d_calendar[Date] )
        )
    )
RETURN
    _ALL - _Result

 

 

I've even tried to do that by using CALCULATETABLE() inside the CALCULATE statement, but it has not properly worked.

 

Do any of you know how to blank out all the red-outlined lines of the image? Something like that is expected:

Pedro503_0-1690096841524.png

 

 

Thanks in advance.

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

pls try this

Amount deducted = 
VAR _ALL = CALCULATE( [Amount] , ALL( d_calendar ) ) -- , CALCULATETABLE( Example ) )
VAR _Result = 
    CALCULATE( 
        [Amount],
        FILTER(
            ALL( d_calendar ),
            d_calendar[Date] <= MAX( d_calendar[Date] )
        )
    )
RETURN
    IF([Amount],_ALL - _Result)

View solution in original post

2 REPLIES 2
Ahmedx
Super User
Super User

pls try this

Amount deducted = 
VAR _ALL = CALCULATE( [Amount] , ALL( d_calendar ) ) -- , CALCULATETABLE( Example ) )
VAR _Result = 
    CALCULATE( 
        [Amount],
        FILTER(
            ALL( d_calendar ),
            d_calendar[Date] <= MAX( d_calendar[Date] )
        )
    )
RETURN
    IF([Amount],_ALL - _Result)

Can't believe the solution is that simple, my friend. Thank you very much.

I've been trying to fix that all the week, but always got the CallBackDataId, which screw the performance in my real-life report. However, with your piece of code you managed to help me out. Cant say other thing but thanks.

 

Have a nice day.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.