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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
FSMS
Frequent Visitor

URGENT HELP needed to get values from yesterday or 15 days ago

HSBC PTP =
VAR _mkids =
    CALCULATETABLE (
        VALUES ( 'dev moment_keywords'[id] ),
        FILTER ( 'dev moment_keywords', 'dev moment_keywords'[moment_id] = 418 )
    )
VAR _tids =
    CALCULATETABLE (
        VALUES ( 'dev moment_mapping'[transcription_id] ),
        FILTER ( 'dev moment_mapping', 'dev moment_mapping'[moment_keyword_id] IN _mkids )
    )
VAR _aids =
    CALCULATETABLE (
        VALUES ( 'dev transcription'[audio_id] ),
        FILTER ( 'dev transcription', 'dev transcription'[id] IN _tids )
    )
RETURN
    IF(ISBLANK(CALCULATE (
        DISTINCTCOUNT ( 'dev audio'[id] ),
        FILTER ( 'dev audio', 'dev audio'[id] IN _aids )
    )),0,CALCULATE (
        DISTINCTCOUNT ( 'dev audio'[id] ),
        FILTER ( 'dev audio', 'dev audio'[id] IN _aids )
    )          )    
 
This formula will give me count of a certain moment . I also have a date slicer using calltime (contains only dates) from dev audio table to filter values for last 30 days. I need to create a visual where I can see the count of the moment at the present as well as the count value from yesterday so I can check for growth or decay. Please help me modify this dax.

i have tried formulas like dateadd and today()-1 and the regular stuff but I am stuck , so kindly help me out if possible.                                                                                                                                                                                                                                                                            
2 REPLIES 2
Ritaf1983
Super User
Super User

Hi @FSMS 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

This is the data model  for the above formula and  everything is relatedThis is the data model for the above formula and everything is related

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.