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
Irache
Helper II
Helper II

Summarize table with another column of another table

Hello,

I have this Dax formula :

Irache_2-1680680911648.png

 

This DAX formula make a group by column with two columne of my date table named "Date_IN_OUT" especially with "Semaine entreprise" column which is  the Compagny Week which take value like "2023-01"  and the two metric choose for this group by are a two sum based on different filter of my fact table "Data".

Now I want to group by on another column but this column isn't in my Date table but with my fact table and I don't how I can make that. 
Note that my fact table and date table are link with ther column :

Irache_3-1680681368048.png


and this summarize table which I made are link with my fact table like this :

Irache_4-1680681484051.png

I hope someone can help me please.

13 REPLIES 13
tamerj1
Super User
Super User

@Irache 
You can summarize 'Data' instead of 'Date_In_Out'. That would give you access to the columns of both tables.

Thanks for your response, it's work but partially the value for the result isn't good :

Irache_0-1680698097314.png

Irache_1-1680698194006.png

The number of IN are the same for each shop it's obviously a problem in my measure for calculate the number of IN and OUT but I cannot find it.

@Irache 

If you delete FILTER ( ALLSELECTED ( DATA ) ) part what do tou get?

It's give me well number for the IN column but for the OUT column it's not good

Irache_0-1680700301692.png

 

@Irache 

For OUT add CROSSFILTER ( 'Table'[IN Date], 'Date'[Date], NONE )

Where I add this functon in OUT column ?

Irache_0-1680705337151.png

 

@Irache 

No. 
place it before FILTER as a seperate argument of CALCULATE 

It doesn't work 

Irache_0-1680709104135.png

Irache_1-1680709148434.png

 

 

@Irache 
Please try

Entrée/Sortie =
VAR lastDataWeek =
    MAX ( Data[#Semaine de mesure] )
RETURN
    SUMMARIZE (
        'Data',
        'Date_IN_OUT'[Semaine Entreprise],
        'Date_IN_OUT'[Mois Entreprise],
        'Data'[#Nom complet magasin],
        "Entrée",
            SUMX (
                FILTER (
                    Data,
                    Data[#Semaine entrée] = 'Date_IN_OUT'[Semaine Entreprise]
                        && Data[#Semaine de mesure] = lastDataWeek
                ),
                Data[#Nombre entrée]
            ),
        "Sortie",
            SUMX (
                FILTER (
                    Data,
                    Data[#Semaine sortie] = 'Date_IN_OUT'[Semaine Entreprise]
                        && Data[#Semaine de mesure] = lastDataWeek
                ),
                Data[#Nombre sortie]
            )
    )

It's not the well result.

Irache_0-1680763835024.png

May be we must place a REMOVEFILTER or KEEPFILTER function ?

Hello,
Do you have a solution please ?

Greg_Deckler
Super User
Super User

@Irache Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Sorry for this forget, so currently I have this table after the DAX function :

Compagny

Week

Count

IN

Count

OUT

Year

In

progress

Compagny

Month

Month

Number

2008-05517-420085172008-M011
2008-062-15320081512008-M022

 

And I want to have this table:

Compagny

week

Count

IN

Count

OUT

Year

In

Progress

Compagny

month

Month

number

Shop
2008-05500-220084982008-M011Mag1
2008-061-1002008-992008-M011Mag1
2008-0517-22008-152008-M011Mag2
2008-061-532008-522008-M011Mag2


The problem is the Shop column is in my fact table "Data" and my summarize function is based on my date table.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors