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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
charleshale
Responsive Resident
Responsive Resident

Parallelperiod () failing in a SUMMARIZE table .... but working otherwise

I am using a relatively common measure for activesubs at any given period that simply counts  unique email addresses that were added before or equal to the last date in a period and didnt go inactive.

 

|1|ActiveSubs| =  
VAR _startofperiod = MIN ( DimDate[Date] )   --DimDate is a standard calendar table
VAR _endofperiod = MAX ( DimDate[Date] )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( Table2[Email] ),
        Table2[Churn_DateAdded] <= _endofperiod,
        Table2[Churn_Hard+Soft90InactiveDate] > _endofperiod
        ),
        REMOVEFILTERS ( DimDate )
    ) 

 

This measure works just fine, including with time-shifting measures like PARALLELPERIOD() and and PREVIOUSMONTH().  However, oddly, it fails if I attempt a simple summarize such as

 

Test Table = AddColumns (
Summarize (Table2, DimDate[Year],
"Active Subs",   [|1|ActiveSubs|]),
"Active Subs Prior Yr",  Calculate ( [|1|ActiveSubs|] , PARALLELPERIOD (DimDate[Date],-1, YEAR)))

 

 

 

Specifically the "Active Subs Prior Yr" column remains blank. Has anyone ever seen this?   Is it that PREVIOUS_________ or PARALLELPERIOD require continuous days of a date table and that filter context doesnt get passed through in a SUMMARIZE where only a column of the date table gets summarized?

1 ACCEPTED SOLUTION
charleshale
Responsive Resident
Responsive Resident

UPDATE: The source of the problem was an object conflict. 

View solution in original post

5 REPLIES 5
charleshale
Responsive Resident
Responsive Resident

UPDATE: The source of the problem was an object conflict. 

TheoC
Super User
Super User

Hi @charleshale, may it be linked to the Summarize being on the DimDate[Year] (i.e. Year) and the Parallel Period being linked to a prior Month?  The Summarize function usually summarises the respective column from my understanding. I could be wrong, but this may be causing the issue.

 

Best of luck either way.

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

charleshale
Responsive Resident
Responsive Resident

Thanks, @theo.  I tried it as well with 

Test Table = Summarize (Table2, DimDate[Year],
"Active Subs",   [|1|ActiveSubs|],
"Active Subs Prior Yr",  Calculate ( [|1|ActiveSubs|] , PARALLELPERIOD (DimDate[Date],-1, YEAR))

And get the same issue.  

 

I wonder if SUMMARIZE () can't handle the data transposition between a data table columns if the SUMMARIZE use DimDate[Year] and a column calc calls for DimDate[Date]

Hi @charleshale, no trouble at all!

 

A quick one, it may be my limited understanding on usability / functionality of the SUMMARIZE function, however, I thought the first component of the SUMMARIZE function needed to be the Table  that matched the column to be summarised?

 

TheoC_0-1633918609490.png

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

charleshale
Responsive Resident
Responsive Resident

I'm no  expert  but just on PowerBI a ton and I routinely use SUMMARIZE() with all tables that are related  -- ie   SUMMARIZE (Table,  Table2[col1], Table8[col7]) -- although I reckon it isnt best practice when SUMMARIZECOLUMNS can be used.

 

And I certainly am able to get what I want with SUMMARIZCOLUMNS

 

AA_WBS2 = 
SUMMARIZECOLUMNS (
    DimDate[YearMonthnumber],
    "Subs", [|1|ActiveSubs|AP|],
    "Subs Prev Month1", [|1|ActiveSubs_#PriorMo|H&S|AP],
    "Subs Prev Month2", CALCULATE([|1|ActiveSubs|AP|], PREVIOUSMONTH(DimDate[Date])))

 

 with both a measure and PREVIOUSMONTH calc.....so I wonder if the error at top is about (A) SUMMARIZE not being able to work with full date table if only a column of that datetable is summarized, or (B) that, per msft documentation, for PREVIOUS[period] time intel functions to work, all dates need to be present for the years required.  

 

If I had to guess, I'd bet the issue a bit of both:   ie that PREVIOUS___________  can't work with a summary table that doesnt have Date[Date] as a component.    Has anyone ever used SUMMARIZE(   without Date[Date] and been able use PREVIOUS_____ as a function in the summarize table columns?

 

Any thoughts from the studio audience on this?  

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.