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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Analitika
Post Prodigy
Post Prodigy

Userelationship connection with second relation

I have BlanksRowTable  table

 

Blank

1

..

12

 

which has relation with Date table Month field
BlanksRowTable[Column1] -> Date[Month]

Table[date] has inactive relation with Date[date]

Clustered columns chart Visual has in Axis BlanksRowTable[Column1]

So when Table[date] Active relation with Date[date] everithing works good and i see Blanks in visual

 

194 =
CALCULATE (
SUM ( 'Table'[Sum] ),
FILTER (
ALL('Table'),
'Table'[State] IN { "on", "edit" } &&
ISBLANK('Table'[date])
)
)

 

But when Table[date] has inactive relation with Date[date]

and i use userelationship

 

194 =
CALCULATE (
SUM ( 'Table'[Sum] ),
USERELATIONSHIP('Table'[date],'Date'[date]),
FILTER (
ALL('Table'),
'Table'[State] IN { "on", "edit" } &&
ISBLANK('Table'[date])
)
)

 

i dont see blank anymore in visual

So how to fix that?

1 ACCEPTED SOLUTION

Hi @Analitika ,

 

We create a new date table to be a slicer that has no relationship with other tables.

 

us1.jpg

 

We need to create a measure to control the Axis. Put the measure to Filters on this page, like following screenshot.

 

Measure = 
var _sel = MAX('Date table'[Date])
var _month = MONTH(_sel)
return
IF(MAX(BlanksMonths[Column1])<=_month,1,0)

 

us2.jpg

 

Then we can create a Date2_measure you can refer.

 

Date2_measure =
VAR _sel =
    MAX ( 'Date table'[Date] )
VAR _month =
    MONTH ( _sel )
VAR _date2 =
    CALCULATE (
        SUM ( 'Table'[Sum] ),
        USERELATIONSHIP ( 'Date'[Date], 'Table'[Date2] ),
        'Table'[State] IN { "5", "6" }
    )
VAR _date2_blank =
    CALCULATE (
        SUM ( 'Table'[Sum] ),
        USERELATIONSHIP ( 'Date'[Date], 'Table'[Date2] ),
        'Table'[State] IN { "5", "6" },
        ISBLANK ( 'Table'[Date2] ),
        ALL ( 'BlanksMonths' )
    )
VAR _date2_all =
    CALCULATE (
        SUM ( 'Table'[Sum] ),
        USERELATIONSHIP ( 'Date'[Date], 'Table'[Date2] ),
        'Table'[State] IN { "5", "6" },
        BlanksMonths[Column1] <= _month
    )
VAR _date3_last =
    CALCULATE (
        SUM ( 'Table'[Sum] ),
        USERELATIONSHIP ( 'Date'[Date], 'Table'[Date3] ),
        'Table'[State] IN { "5", "6" },
        BlanksMonths[Column1] = _month
    )
RETURN
    IF (
        MAX ( BlanksMonths[Column1] ) = _month,
        _date2_all + _date2_blank + _date3_last,
        _date2
    )

 

The result like this,

 

us3.jpg

 

If it doesn't meet your requirement, please kindly ask here and we will try to resolve it.

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@Analitika , Try with +0

194 =
CALCULATE (
SUM ( 'Table'[Sum] ),
USERELATIONSHIP('Table'[date],'Date'[date]),
FILTER (
ALL('Table'),
'Table'[State] IN { "on", "edit" } &&
ISBLANK('Table'[date])
)
) +0

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Here i create new file, but now cant reproduce blanks 😞

need change axis type to categorical, then blanks is showing, but removefilter is not working now 😫

 

https://easyupload.io/8xqqml

Hi @Analitika ,

 

We can use two ways to meet your requirement.

 

The first way is to create three measures.

 

1. Create three column charts and use BlanksMonths[Column1] to be the Axis.

 

Date1_measure = 
CALCULATE (
SUM ( 'Table'[Sum] ),
FILTER (
'Table',
'Table'[State] IN { "5", "6" }
)
)
Date2_measure = 
CALCULATE (
SUM ( 'Table'[Sum] ),USERELATIONSHIP('Date'[Date],'Table'[Date2]),'Table'[State] in { "5","6"})
Date3_measure = 
CALCULATE (
SUM ( 'Table'[Sum] ),USERELATIONSHIP('Date'[Date],'Table'[Date3]),'Table'[State] in { "5","6"} )

 

use1.jpg

 

2. We need to change the X Axis type to Categorical, then we can see the blank.

 

use2.jpg

 

use3.jpg

 

The second way it two create three month columns based on Table[Date], Table[Date2] and Table[Date3].

 

1. Create three date month column in Table.

 

Date1_Month = MONTH('Table'[Date1])
Date2_month = MONTH('Table'[Date2])
Date3_month = MONTH('Table'[Date3])

 

use4.png

 

2. Then we can create three column charts based on the three month columns, and put the Table[Sum] in Values.

And put the Table [State] in Filter on this page. Also we need to configure the X axis to Categorical.

 

use5.jpg

 

use6.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ty for great post.

  1. Blanks always must be in visual, like removefilter Date[date] but it not work
  2. Blanks always has same Sum, in you 1 example is good in 2 is bad as it changes depending on slicer slide
  3. Last selected month in slider must must not depend on day and give a Sum until Endofmoth
  4. Also in Date2 visual i need in last month see additional sum from Sum of Last selected month in slider by date3 (need use full date slicer not only months)
    1. for example, if selected in date slicer lastdate = 2020.07.05 (or whatever day in that month) in date2 to visual on 7 month we will see 128.224,56 (sum of whoole 7 month)  in date3 visual we will see 12,40, so I need in date2 visual see (changes only in last month, over month must show it own sum summed by months) 128.224,56 + suminperiod(startdate in date slider, last selected date in date slider Endofmonth) + Blanks + 12.40

2020-07-09_093736.pngNeeded resultNeeded result

Hi @Analitika ,

 

We create a new date table to be a slicer that has no relationship with other tables.

 

us1.jpg

 

We need to create a measure to control the Axis. Put the measure to Filters on this page, like following screenshot.

 

Measure = 
var _sel = MAX('Date table'[Date])
var _month = MONTH(_sel)
return
IF(MAX(BlanksMonths[Column1])<=_month,1,0)

 

us2.jpg

 

Then we can create a Date2_measure you can refer.

 

Date2_measure =
VAR _sel =
    MAX ( 'Date table'[Date] )
VAR _month =
    MONTH ( _sel )
VAR _date2 =
    CALCULATE (
        SUM ( 'Table'[Sum] ),
        USERELATIONSHIP ( 'Date'[Date], 'Table'[Date2] ),
        'Table'[State] IN { "5", "6" }
    )
VAR _date2_blank =
    CALCULATE (
        SUM ( 'Table'[Sum] ),
        USERELATIONSHIP ( 'Date'[Date], 'Table'[Date2] ),
        'Table'[State] IN { "5", "6" },
        ISBLANK ( 'Table'[Date2] ),
        ALL ( 'BlanksMonths' )
    )
VAR _date2_all =
    CALCULATE (
        SUM ( 'Table'[Sum] ),
        USERELATIONSHIP ( 'Date'[Date], 'Table'[Date2] ),
        'Table'[State] IN { "5", "6" },
        BlanksMonths[Column1] <= _month
    )
VAR _date3_last =
    CALCULATE (
        SUM ( 'Table'[Sum] ),
        USERELATIONSHIP ( 'Date'[Date], 'Table'[Date3] ),
        'Table'[State] IN { "5", "6" },
        BlanksMonths[Column1] = _month
    )
RETURN
    IF (
        MAX ( BlanksMonths[Column1] ) = _month,
        _date2_all + _date2_blank + _date3_last,
        _date2
    )

 

The result like this,

 

us3.jpg

 

If it doesn't meet your requirement, please kindly ask here and we will try to resolve it.

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

WOW, very nice with one exception, what not work if data slider slides from left, but works only on right slider

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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