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

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

Reply
aditi11
Frequent Visitor

Sales based on user selection

Hello community, I want to calculate total sales based on user selection. If user selects any no. From 1 to 30 in slicer, then he should be able to see total sales for that day in visual (column chart). I have created parameters for the same. But it is not working. Please help.

Thanks 

Power BI Report Server automatic sign in 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @aditi11 ,

I have created a simple sample, please refer to it to see if it helps you.

Create a calendar date.

Table = CALENDAR(DATE(2022,10,1),DATE(2022,10,31))

Then create a measure.

Measure =
VAR _1sum =
    CALCULATE (
        SUM ( Sheet1[value] ),
        FILTER ( ALL ( Sheet1 ), Sheet1[date] <= MAX ( 'Table'[Date] ) )
    )
VAR _2 =
    CALCULATE (
        MAX ( Sheet1[value] ),
        FILTER ( ALL ( Sheet1 ), Sheet1[date] = TODAY () )
    )
RETURN
    IF ( SELECTEDVALUE ( 'Table'[Date] ) = BLANK (), _2, _1sum )

vpollymsft_0-1665971539746.png

vpollymsft_1-1665971552573.png

If I have misunderstood your meaning, please  provide your pbix file without privacy information and desired output with more details.

 

Best Regards

Community Support Team _ Polly

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @aditi11 ,

I have created a simple sample, please refer to it to see if it helps you.

Create a calendar date.

Table = CALENDAR(DATE(2022,10,1),DATE(2022,10,31))

Then create a measure.

Measure =
VAR _1sum =
    CALCULATE (
        SUM ( Sheet1[value] ),
        FILTER ( ALL ( Sheet1 ), Sheet1[date] <= MAX ( 'Table'[Date] ) )
    )
VAR _2 =
    CALCULATE (
        MAX ( Sheet1[value] ),
        FILTER ( ALL ( Sheet1 ), Sheet1[date] = TODAY () )
    )
RETURN
    IF ( SELECTEDVALUE ( 'Table'[Date] ) = BLANK (), _2, _1sum )

vpollymsft_0-1665971539746.png

vpollymsft_1-1665971552573.png

If I have misunderstood your meaning, please  provide your pbix file without privacy information and desired output with more details.

 

Best Regards

Community Support Team _ Polly

 

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

 

 

aditi11
Frequent Visitor

Hello community, I want to calculate total sales based on user selection. If user selects any no. From 1 to 30 in slicer, then he should be able to see total sales for that day in visual (column chart). I have created parameters for the same. But it is not working. Please help.

@amitchandak 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.