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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Can't get DAX formula to total up when selecting more than one Qtr in slicer

Greetings - 
My Dax formula is giving me the correct results when I select a particular qtr via a slicer in my card visual. So I have my summary section of a report working (all cards are displaying correctly when I select a single qtr. However, when I select multiple qtrs, my goal card visual is not working. In other words, if I select more than one Qtr, I can't get it to add the multiple qtrs together. But the other cards do display correctly. Any help or assistance would be very appreciated! 
DAX logic for the measure is based on a DAX-created table
Measure: Bookings Goal =

                LOOKUPVALUE'2022 Business Goals'[Bookings Goal]'
                                           2022 Business Goals'[Quarter]
,
                IF(
                    HASONEVALUE( tblCalendar[Fiscal_Qtr] ),
                    SELECTEDVALUEtblCalendar[Fiscal_Qtr]BLANK() )

The table that are the goals are in is created via Dax by this code: 
2022 Business Goals =
DATATABLE(
                   "Year",STRING,
                   "Quarter",STRING,
                   "Quarter StartDate",DATETIME,
                   "Quarter EndDate",DATETIME,
                   "Bookings Goal",INTEGER,
                   "Revenues Goal",INTEGER,
                   "New Logos",INTEGER,
                   "Time To Deliver",INTEGER,
                   "Renewal Pct",DOUBLE,
{
{"2022","Q1",44562,44651,2000000,3000000,2,40,.50},
{"2022","Q2",44652,44742,3000000,3500000,5,50,.50},
{"2022","Q3",44743,44834,4500000,4200000,5,50,.50},
{"2022","Q4",44835,44926,5000000,4500000,5,40,.50}
}
)
I'm stumped on this but I couldn't get the value to display correctly originally until I did the Hasonevalue function. But now I can't get it to sum the goals if I select multiple qtr values. Help!
 
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
Please use

Bookings Goal =
SUMX (
    FILTER (
        '2022 Business Goals',
        '2022 Business Goals'[Quarter] IN ALLSELECTED ( tblCalendar[Fiscal_Qtr] )
    ),
    '2022 Business Goals'[Bookings Goal]
)

View solution in original post

3 REPLIES 3
speedramps
Super User
Super User

I am volunteer helper but wish I had a £ every time a power Bi noice asked this question !!

 

A slicer does what is says on tin!

If you slice by Year 2021, or Q2/2022 or Region = France

then that is only what you will get on the report.

 

There are 2 ways to overide this behaviour 

 

Method 1 - click on the slicer / Format / Edit intercations / then click the None icon on your Cards.

The slicer will still apply to all the other visuals except where you have specified none.

 

Method 2

Create 2 measure.  One with the slicer and one that overides the slicer with REMOVERFILTERS.

 

For example
// this measure will be use the slicers

Silcedsales = SUM(Tablename[Sales])

// this measure will not use the calandar slicer

Unslicersales =
CALCULATE(
SUM(Tablename[Sales]),

REMOVEFILTERS(tblCalendar)

)




Thanks for reaching out for help.

I have helped you, now please help me by giving kudos.

Remeber we are unpaid volunteers.

Click the thumbs up and accept as solution button. 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volnteer solver will get the kudos they deserve. Thank you ! 😎

 

tamerj1
Super User
Super User

Hi @Anonymous 
Please use

Bookings Goal =
SUMX (
    FILTER (
        '2022 Business Goals',
        '2022 Business Goals'[Quarter] IN ALLSELECTED ( tblCalendar[Fiscal_Qtr] )
    ),
    '2022 Business Goals'[Bookings Goal]
)
Anonymous
Not applicable

Thank you @tamerj1 - that was exactly what I was looking for. I hadn't thought about using sumx function. And I know my users will do multi-select on my summary page hence my question. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.