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
Anonymous
Not applicable

Bring Value from table based on Date and additional filters

Hi everyone, I am relatively new to powerBi so I appreciate your help with the following:

 

I have the following data table:

 

Date             / DigitalFlag / VisitedFlag    / # _ operators
12/2020 / DIGITAL    / NON VISITED / 41
01/2021 / DIGITAL   / NON VISITED / 5
02/2021 / DIGITAL   / NON VISITED / 10

 

I would lilke to add a card showing the number of operators of the last moth for the different combinations: DIGITAL / VISITED; NON DIGITAL / VISITED; DIGITAL / NON VISITED; NON DIGITAL / NON VISITED.... 

In other words, if today is Febrary 2021, I would like a measure that brings me 5 as the number of operators for the combination DIGITAL / NON VISITED during January.

 

Thank you in advance for your help

7 REPLIES 7
Syndicate_Admin
Administrator
Administrator

Hello, please can you help me.

I have in the visual the amount of the month that is fine, the previous month that is also correct, the amount of the present year (2022) to the date of the slider range (January to May), but I do not get the amount of the previous year (2021 from January to May), in the column "Acum. YTD"

JoshMed_0-1662149426442.png

Acum. YTD = calculate(sum(ERI[Valor]),PREVIOUSYEAR('Calendar'[Fecha]))

JoshMed_1-1662149454243.png

Thanks in advance.

parry2k
Super User
Super User

@Anonymous 'm still not sure what is working and what is not working and what you want. It will be much easier if you share a sample pbix file with clearly defined what you are expecting and how you are planning to interact with the report. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Anonymous there are two ways to solve it, create one measure using PREVIOUSMONTH and in visual, use Date/Digital Flag/Visited Flag and the PREVIOUSMONTH measure

 

or create four different measures for each combination and to do so, you need to filter Digital Flag and Visited Flag in each measure. Hope this helps.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

selimovd
Super User
Super User

Hey @Anonymous ,

 

I'm not sure if you need the filter for DigitalFlag and VisitedFlag as the values are the same. But I included them.

Try the following approach:

Operators last Month =
CALCULATE(
    SUM( myTable[# _ operators] ),
    DATEADD(
        myDateTable[Date],
        -1,
        MONTH
    ),
    ALL( myDateTable ),
    myTable[DigitalFlag] = "DIGITAL" & myTable[VisitedFlag¨] = "NON VISITED"
)

 

Be aware that you need a proper date table that the time intelligence functions are working.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 
Anonymous
Not applicable

Thank you, this solution took me much closer to what I am looking for. Altough it is showing me the SUM of all operator in different months under the DIGITAL & VISITED FLAG, and I only want last month. I dont know if the fact that iI only have one value per month might be affecting ... This is how my data actually looks like:

amlogan_0-1623081703503.png

so if I choose non digital & visited I should get from the measure: 12 which is the value from last month April. If I select digital & visited I should get 4... i dont mind creatin as may measures and add specific filters. Thank you again!
I dont mind to create different measures for each one, but for now is just addin

If I choose 

 

parry2k
Super User
Super User

@Anonymous you need to look into the time intelligence DAX functions called PREVIOUSMONTH or DATEADD

 

But before you use these functions you need to add a date dimension in your model which is a recommended best practice when working with time intelligence functions. Once it is added to the model, the rest is pretty straightforward. You can add date dimension following my blog post Create a basic Date table in your data model for Time Intelligence calculations | PeryTUS IT Solutions

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Thank you for answering. I already have a dim Date table in my dasboard linked to the date column of my table... the strugle is in creating the measure considering last month number of operatros for each of the flags I currently have (if visited or not ANd if digital or not).

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.

Top Solution Authors